Last updated: Jun 02, 2020 13:24
Sensor instrumentation
Perfecto supports interaction with the different input sensors of mobile devices in the Perfecto Lab to inject different data to allow easy, reproducible testing of applications. For example, the image inject functionality allows the tester to provide an image file to the device camera. Before using the sensor functionality, the application needs to be instrumented to provide an indication to the Perfecto Lab when the sensor prompts the user for data.
Sensor instrumentation is activated during application installation:
- Manual testing: Install the application using the Install application form. After adding the application file, turn on the Sensor instrumentation toggle (see image below) and click Install App.
- Legacy | Perfecto Automation/UFT: Use the Install application function and set the sensor instrumentation parameter to sensor.
- Selenium: Set the "sensorInstrument" parameter of the mobile:application:install Perfecto command to sensor.
- Appium: Set the "sensorInstrument" capability to true when starting the application during driver creation.
Instrumentation in manual testing - install application
Instrumentation parameters of install application - native automation
Camera instrumentation
Perfecto supports an image injection feature that simulates image input from the device camera. The application must be prepared for image injection during the installation process using sensor instrumentation.
Authentication instrumentation
Perfecto supports a sensor authentication simulation feature that simulates an authorization analysis using the device fingerprint reader or face recognition system. Using this feature requires that the application that accesses the authentication sensor be instrumented (with sensor instrumentation) to let the test/automation script identify the activation of the sensor.
Re-signing of the application
For more information, see Re-sign an application.
Known limitations
The following limitations for Perfecto instrumentation of mobile applications are known:
General Instrumentation Notes
- iOS application file names should not include bracket ('[', ']') characters
- When a Lab is upgraded to a new version, re-instrumenting hybrid applications is required in order to get all the latest functionality. Customers should uninstall the application from the device, instrument it and install it again.
- Applications that include dynamically generated code, for example Java code generated by annotations, cannot be instrumented.
- Uninstall an app before installing a new version. Installing a new version of an instrumented application, when a previous version is already installed, may not upgrade correctly.
- Apps installed from the Apple App Store cannot be instrumented. This is a limitation enforced by Apple for security reasons. Apps in the App Store are signed with a "Distribution" provisioning profile/certificate and cannot be re-signed. In order to be instrumented an app must be signed with a "Development" provisioning profile/certificate.
Sensor Instrumentation Notes
- Instrumentation is supported only for code based on the Google Android SDK. OEM APIs, for example the Samsung Fingerprint API, are not supported
- If you receive the error: Target Application is not instrumented - Note that Sensor instrumentation is supported only for a single application on the device. If an application on the device, other than the currently tested application, is sensor instrumented, close it before testing the current application.
Instrumentation and Anti-temper solutions
As part of all types of instrumentation, Perfecto libraries are added into the app archive before is it installed on the device. Unfortunately this does not play well with anti temper protection solution such as Proguard or Arxan. It is recommended to use builds that do not include anti-temper protection for testing with Perfecto.
In case the app needs to be tested with anti-temper protection, offline instrumentation should be performed as part of the App build process before any anti-temper protection is applied. For further details refer to iOS offline instrumentation or Android offline instrumentation.