Instrument the app using Appium capabilities

Use the capabilities listed in the following sections during driver creation to instrument an app installed on a Perfecto device. Each capability targets a specific testing scenario.

To learn more about the instrumentation methods supported by Perfecto, see the Instrumentation section.

Prerequisites

Make sure the app is installed using the appropriate method (for example, using the app capability or Perfecto commands) and is compatible with instrumentation.

Instrument a hybrid app (Android only)

To enable instrumentation for hybrid apps on Android devices, include the following capability. This automatically instruments the application as part of the Appium session.

Perfecto supports the following instrumentation methods for applications installed on the devices:

Copy
capabilities.setCapability("autoInstrument", true);

Instrument an app that uses device sensors

If your app uses sensors such as the camera or fingerprint reader, enable sensor instrumentation by including the following capability. This allows you to use Perfecto’s data injection commands to simulate sensor input during testing.

Copy
capabilities.setCapability("sensorInstrument", true);

Instrument secured screens (Android 12 or later)

On devices running Android 12 or later, secured screens are currently subject to a limitation that is linked to FLAG_SECURE, a flag that was originally declared for better security and preventing screenshots, but that now prevents screen captures and screen video recording on devices running Android 12 or later, causing the screen to appear black and affecting the testing process.

To enable testing of these screens, include the following capability. This removes FLAG_SECURE from your app at runtime, making secured screens visible.

Important: Default value is false. This only affects setFlags() and addFlags() calls that use FLAG_SECURE.
Copy
capabilities.setCapability("securedScreenInstrument", true);