Page tree
Skip to end of metadata
Go to start of metadata

Last updated: Oct 29, 2019 13:55

Instrumentation is a process to prepare the application for testing or automation. Part of the instrumentation process may add "instruments" that allow the testing framework to gain access to parts of the application.

Perfecto provides tools for instrumenting mobile applications for different purposes.

Instrumentation of hybrid applications

Hybrid applications, applications that display parts of the UI in WebView objects, require basic instrumentation to provide access to the parts of the UI hosted in the WebView objects.

Perfecto supports the following types of instrumentation:

  • On-the-fly instrumentation (iOS and Android): Performed when installing the app on the device. Perfecto Mobile updates the instrumentation library, but you need to re-install the app after every version update and not use the previously installed app.
  • Customized instrumentation (iOS only): Performed from a Mac workstation using a Python script to activate the different instrumentation flavors.
    You can instrument the app while maintaining the original application entitlements and signature.

  • Offline Instrumentation (Android only): Performed on the application's apk file. Generates an instrumented apk file that you can store and later install directly onto the Android device. You need to download a new version of the "Perfecto-Lib" and re-instrument after every Perfecto version update.

On this page:

Hybrid application instrumentation notes:

  • Instrumentation is required to gain access to DOM objects in Hybrid apps.
  • As a general rule, on-the-fly instrumentation is preferred over framework instrumentation.
  • In addition to SingleDex and Objective-C apps, Perfecto also supports instrumentation for MultiDex apps (Android) and Swift apps (iOS).
  • Instrumentation only affects the application code. It does not affect mobile OS performance or activity.

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 app widget. After providing the application's repository location, several instrumentation options are offered. The second instrumentation is sensor instrumentation. Set the value to True.
  • 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-sign the application

For more information, see Re-sign application - iOS.

Known limitations

See the general limitations article.