Record Mobile tests

This topic describes how to record OpenText Functional Testing tests on your mobile apps.

Mobile recording prerequisites

Ensure you have the following completed before starting to record your GUI test or component:

Prerequisites Description
Set up your environment

Test your connection to OpenText Functional Testing Lab or to a local device and verify your Record and Run Settings.

For details, see Set up advanced mobile testing or Record Mobile tests.

App packaging and signing

You may need to set up packaging and signing services, or to prepare your apps before you start.

For more details, see the OpenText Functional Testing Lab Help.

Retrieve properties for Android system apps

Retrieve Android properties as needed, and map them to OpenText Functional Testing or OpenText Functional Testing Lab properties.

For details, see Test Android system apps.

Back to top

Basic mobile recording steps

To record steps on a mobile application:

  1. Start your recording session:

    In OpenText Functional Testing, select Record > Record. A remote access window opens, connected to the device you specified.

    Recording business process tests on Web apps

    If you are recording a business process test on a Web app, the browser opens to the last URL used in a test run.

    In such cases, navigate manually to the correct page to start performing your tests.

    You may need to delete a step for loading the incorrect page after you finish recording.

  2. Perform your steps on your device in the remote access window.

    Your operations are recorded and test objects are added to the object repository as you go along.

    In the object repository, the mcindex description property is used instead of the Ordinal Identifier mobile test object property.

    Screenshots / device logs

    To take a screenshot of your device or to collect device logs, click Take screenshot or Download device logs on the Options panel on the left of the remote access window.

    For more details about these options, see the OpenText Functional Testing Lab Help.

    Switch devices

    Each recording session supports recording on a single device only.

    However, you can edit your test after recording to run on multiple devices. For details, see Add steps to open different devices.

    Tip: In between recording sessions, switch the device and app settings in the Record and Run Settings to record on different devices.

    Switch apps

    To record a single test on multiple apps, stop your recording and either modify the Record and Run Settings to use a new app, or open your new app manually.

    Start recording again and continue performing your steps.

    Android apps: Add steps to open additional apps using Insight recording or the uiAutomatorViewer. For details, see Add steps to open additional apps.

    Handling errors when loading your app

    If the remote access window does not completely load your app UI, OpenText Functional Testing can continue to interact with the mobile device, and records any steps you perform.

    However, in such cases, you cannot use Insight recording. For more details, see Record Insight steps for web apps on your mobile device.

    Recording gestures

    Recording gestures on your devices may result in inaccurate steps.

    Check your step syntax after recording and modify your steps as needed.

    For more details, see Gestures in the OpenText Functional Testing Lab Help.

    Note: Low-Level recording is not supported.

  3. When you're done, click Stop.

    The remote desktop window remains open with your device, and you can continue to use the device. However, the device is also released, making it available for other OpenText Functional Testing Lab users.

Back to top

Record Insight steps for web apps on your mobile device

Insight helps you identify test objects in your app based on what they look like on your screen, instead of their properties or technology.

Use Insight to capture images and run steps on objects in your app that might otherwise be unavailable to OpenText Functional Testing.

  1. Start your recording session.

  2. In the remote access window:

    • Browse to the device's HOME screen
    • Ensure that your remote access window is set to 100% zoom.
  1. In the Record Toolbar, in the Recording Mode drop down list, select Insight Recording.

  2. In the remote access window, in the mobile device, launch the device browser and navigate to the web application you want to test.
  3. Record the necessary steps on the device's browser. While you record, steps and objects are added to the test and object repository, respectively.

    Each object you use is recognized as an InsightObject under the parent Device test object.

  4. Click Stop to stop the recording session.

The following code is an example of Insight steps recorded on a device.

Device("Device").Home
Device("Device").InsightObject().Click
Device("Device").InsightObject().Click

Back to top

Record a simulated event

Record simulated events, such as receiving an SMS, to test that your app responds properly to those events.

Note: Simulated events are not actual events. So, for example, a simulated incoming call cannot be answered, and a simulated SMS cannot be opened.

Record simulated events

  1. Define your Record and Run Settings, and start recording.

  2. (Optional) In your test, move your cursor to where you want to add the simulated event.

  3. In the Options pane in the remote access window, click the button for the required simulation.

    The relevant dialog box opens for the selected simulation and prompts you for details.

    Incoming SMS

    Incoming phone call

    Send app to background

    GPS relocation

    Set the duration from 1-15 seconds.

    Use numerical GPS coordinates. Valid values:

    • Latitude: min: -90, max: 90
    • Longitude: min: -180, max: 180

    Camera Simulation

    Specify the location of the photo (on the file system or URL)

    Video Simulation

    Specify the location of the photo (on the file system or URL)

    Lines are added to your test for the simulation you defined. For example:

    Device("Device").IncomingSMS "1800859645","Hello There",5,True
    
    Device("Device").GPSRelocate 37.555000,-122.500000
    Device("Device").App("PhotoViewer").SimulateCamera chd23421
    Device("Device").App("PhotoViewer").SimulateVideo chd23421
  4. Stop recording.

  5. If you added a SimulateCamera or SimulateVideo step, you may need to add a StopSimulateCamera and StopSimulateVideo step manually after recording.

Tip: Learn more about gestures and view code examples for simulated events in the Mobile section of the Object Model Reference.

Back to top

Add checkpoints and output values

Add checkpoints and output values for your device test objects during recording sessions. Supported checkpoints include standard, bitmap, and text checkpoints.

To insert a checkpoint or output value:

  1. In the Record Toolbar, click the Insert Checkpoint or Output Value button and select the type of checkpoint or output value you want to add.

  2. In the remote access window, click the device to select it.

  3. In the Object Selection dialog box, select the Device test object.

  1. In the Checkpoint Properties dialog box or Output Value Properties dialog box, specify the settings for the checkpoint object or output value step. For example:

  2. To reuse a checkpoint or output value step, select one of the following:

    • Design > Checkpoint > Existing Checkpoint

    • Design > Output Value > Existing Output Value

Back to top

Record tests on hybrid apps

When working with hybrid mobile apps, you must wait for a page to load completely to record steps performed on that page.

This ensures that the objects on that page can be properly identified in both recording and run sessions. A page that has not yet completely loaded may have missing objects, or objects in the wrong locations.

In such cases, add a Wait statement to allow the web page to load completely before the steps are run.

The following code is an example of a Wait statement added before a checkpoint step:

Device("Device").App("Mobile Browser_2").MobileEdit("url").SetFocus
Device("Device").App("Mobile Browser_2").MobileEdit("url").Set "http://mysite.com"
//wait 10
Device("Device").Check CheckPoint("Device_11")

For more details, see Test hybrid apps.

Back to top

Use text recognition

Use text recognition to verify or retrieve text in your objects during a recording, run, or spy session.

Note:  

  • Text recognition on mobile devices depends on OpenText Functional Testing's OCR engine. For more details, see Text recognition in run-time.
  • Do not move or close the Text Search Utility dialog box while the text recognition is processing.

Use the Text Search Utility to create text steps:

  1. Define the Record and Run Settings for your app and device, and start recording.

  2. In top-left corner of the remote access window, click the OCR button.

  3. In the Text Search Utility dialog box, click near the text string you want to recognize, or search for the text string you want to recognize in the Text to Search field.

    If you've clicked near text

    If you've clicked, the closest text string to your click is highlighted, and the step is listed at the bottom of the dialog box.

    For example: ClickOnText "Camera",3

    If you've searched for a string

    If you've searched, the instances of the recognized text string are highlighted in the remote access window.

    For example:

    Then, click near one of the instances of text. The step is listed at the bottom of the dialog box.

  4. Click one of the following:

    • Perform Command / Refresh. Perform the command on the device without adding a step to your action.

      The device image is updated in the remote access window.

    • Add Line. Add the step as a new line in your current action. For example:

      Device("Device").ClickOnText "Camera",3

Back to top

See also: