Mobile testing features

This topic describes how to use different Digital Lab (UFT Mobile) features in UFT Developer tests.

Fingerprint and facial recognition authentication

When running tests on mobile devices, use the mobile application test object's simulateAuth* methods and properties to simulate fingerprint and facial recognition authentication. For details, see the .NET, Java, and JavaScript SDK references.

Back to top

Simulate scanning a barcode or QR code

In your mobile UFT Developer tests, you can include steps that simulate scanning a barcode or QR code using an image file. Use the mobile application test object's simulateBarcodeScan method in the UFT Developer SDKs. For details, see the .NET, Java, and JavaScript SDK references.

Back to top

Check device vitals

UFT Developer's mobile SDK includes an API for checking a device's CPU and memory usage. The information retrieved is an accumulation of the vitals from the moment the device was locked until it has been released.

To check device vitals:

  1. When locking a device, specify the device vitals that you want to collect during this session.

  2. Retrieve the collected vitals for the locked device by calling the getVitals method.

    The returned value of this method, is a string in the following format:

    <requestedVitalName1> <value> <timestamp>

    <requestedVitalName2> <value> <timestamp>

    <requestedVitalName3> <value> <timestamp>

    <requestedVitalName1> <value> <timestamp>

    <requestedVitalName2> <value> <timestamp>

    <requestedVitalName3> <value> <timestamp>

  3. View the accumulated data for the device vitals in the UFT Developer run report:

    • View a graphical representation of the data collected over time in the System Monitor tab.

    • Hover over an area in the graph to see the device vitals relevant to that point in time.

For more details, see the SDK references:

  Java SDK .NET SDK JavaScript SDK

Methods for locking a device and specifying device vitals to collect




Example of collecting accumulated device vitals

Java example .NET example JavaScript example

Back to top

Service Virtualization integration (early access)

Note: Supported only in the following situation:

  • UFT Developer Java and .NET tests running on Windows machines.

  • Working with Digital Lab (UFT Mobile) versions 23.4 and earlier.

If your Digital Lab (UFT Mobile) is set up to integrate with Service Virtualization (SV), your UFT Developer tests can include SV actions in your tests. These steps use scenarios that were created in advance from SV learning sessions.

To use this integration you must perform the following steps:

  1. Set up Digital Lab (UFT Mobile) integration with SV, and prepare the service and scenario files that you want to use.

    For details, see Service Virtualization Help Center.

  2. Set up UFT Developer integration with Digital Lab (UFT Mobile).

    For details, see Connect to the mobile device lab and Create mobile tests.

  3. In your mobile test perform the following steps:

    Step Java SDK .NET SDK

    Lock a device and enable SV for this session.

    When locking the device, set the DeviceSessionOptions class's EnableServiceVirtualization property to true.



    Upload the service to the device.

    Sends Digital Lab (UFT Mobile) the service definition. Digital Lab (UFT Mobile) then communicates with SV to upload the service.

    svUploadService SvUploadService

    Upload the scenario to the device.

    Send Digital Lab (UFT Mobile) the path to the folder that contains the scenario definition files. Digital Lab (UFT Mobile) then communicates with SV to upload the scenario and make it available in this session.

    svUploadScenario SvUploadScenario

    Start the scenario.

    Instruct Digital Lab (UFT Mobile) to have SV start the scenario so that you can use it to test your application.

    Then, perform steps on your application that require this scenario for testing.

    svStartScenario SvStartScenario

    Stop the scenario.

    When you no longer need the scenario to simulate the service's behavior for your test, stop the scenario.

    svStopScenario SvStopScenario

    You can also see .NET and Java code samples for using service virtualization.

Back to top

See also: