Define Mobile Record and Run Settings

This topic describes how to define your UFT One Record and Run Settings for various mobile testing scenarios.

Access the Mobile Record and Run Settings

In your test or component, access the Record and Run Settings as follows:

  • In a test, select Record > Record and Run Settings.
  • In a component, open the component's application area, and then expand the Additional Settings tab.

Note: Application area settings are limited to a single device and application. For details, see Prepare for BPT testing on multiple devices.

Additionally, if you have modified the UFT Mobile server values in the UFT One options dialog, close and re-open your Application Area to refresh the server value.

Define your settings in the Web or Mobile tab, depending on what you're testing:

Mobile testing

Select Mobile to test mobile apps.

Web testing

Select Web to test web apps, on a desktop machine or a device.

Web app testing includes:

  • Desktop testing using the Chrome emulator
  • Device testing using the UFTM Browser app, or the Chrome or Safari native mobile browsers.

For example:

Mobile Test using UFT Mobile

Mobile Component

Web Test

Web Component

Continue with one of the following:

Note: If you use the UFT Mobile Wizard to define your settings (such as if you click Open in UFT Mobile) close the wizard when you're done. Recording is disabled if the wizard is open.

For more details, see the UFT Mobile Help.

Back to top

Define settings to test mobile apps

If you are testing mobile apps on mobile devices, do the following:

  1. On the Mobile tab, select Use UFT Mobile or Use local device.

    One of these options is displayed, depending on whether you connected UFT One to UFT Mobile or to a local device. To change the connection go to ToolsOptions > GUI Testing > Mobile. For details, see Connect to UFT Mobile or local mobile devices.

  2. To view updated device and app details, clear all current selections, and click Refresh .

  3. Define the following Mobile setting values:

    Device

    Local device testing: Have UFT One select a connected device according to the device capabilities you specify, or specify a specific device to test.

    UFT Mobile: Have UFT Mobile select a device for you from available devices in the lab, or specify a specific device to test.

    • Green lock icon = The device is in use by you.
    • Red lock icon = The device is in use by someone else.
    • Device icon with a line = Device is disconnected.
    App Settings

    Select the app or apps you want to test.

    To add apps to the list, do one of the following:

    Using UFT Mobile: Click Open in UFT Mobile to use the UFT Mobile Wizard.

    Testing on local devices: Click + to browse to and open an application stored on the UFT One machine.

    Hover over an app to view it's details, such as the upload number, the app version, or the relevant UFT Mobile workspace.

    Notes for local device testing: 

    • You can select only one app.
    Test Options

    Define the following options for your test:

    Actions. Define whether you want your selected apps installed and restarted at the start of your test, and uninstalled at the end of your test.

    Launch on Start. Define which app you want to launch automatically at the start of your test. Other apps are not started automatically.

    Device Metrics. Define the device metrics you want to log during your test.

    If UFT One is connected to UFT Mobile, you can define the settings directly in the Record and Run Settings dialog, or you can click the Open in UFT Mobile button to use the UFT Mobile Wizard.

    Use the UFT Mobile Wizard in the following cases:

    • If you are using a device stored on Amazon Web services.
    • If UFT One warns you that you have settings defined for a previous version of UFT Mobile.
    • App settings: If you want to use a different upload number than the app displayed.

    For more details, see the UFT Mobile Help.

Back to top

Define settings to test Web apps using a mobile browser

If you are testing Web apps using a mobile browser, on a mobile device, do the following:

  1. If you are testing a native browser, install it on your device before running your test.

    If you are using Chrome as a native browser, ensure that it is set as the default browser. If your device does not enable you to set a default browser, disable the default browser.

  2. On the Web tab, select Open the following when recording or running, and define:

    • Use Micro Focus UFT Mobile

    • The URL of your web app.

    • Whether to use the settings on the Mobile tab or define mobile settings separately.

  3. In some scenarios, the browser app is not launched automatically.

    In such cases, add steps to your test to launch your browser app before performing other test steps, or modify browser and device values for each test iteration.

    These scenarios include:

    • If you did not define a browser app. In such cases, the test uses the device's native browser.
    • If you defined the browser as the UFTM Browser app, as an additional app.

    For more details, see Parameterize browser and device values for Web tests.

Back to top

Define settings to test Web apps using the Chrome emulator

The Chrome emulator enables you to record tests that can be run on both desktop and mobile browsers, as well as test devices not yet supported by UFT Mobile.

  1. On the Web tab, select Open the following when recording or running, and define:

    • Use Local Browser

    • The URL of your web app

    • Browser: Chrome Emulator. If you do not see this option, make sure you have Chrome installed.

    • A device, selected from the drop-down list.

    Alternately, modify browser and device values for each test iteration. For details, see Parameterize browser and device values for Web tests.

  2. Specify and configure your emulated devices using the EmulatedDevices.xml file. For details, see Configure your emulated devices.

Back to top

Parameterize browser and device values for Web tests

Data drive your tests during runtime by modifying browser and device values for each test iteration.

When you run your test, each iteration takes data from the parameter values. When working with an emulator or the UFTM Browser app, UFT One looks for test objects whose description properties match the parameter values.

  1. On the Web tab, select Parameterize runtime web settings using:, and then define your parameter value location:

    • GlobalData Table. For global parameters, defined in the Data table.
    • Test Parameter. For test parameters, defined in the Properties pane.
  2. Define the name of the parameter used to define the browser. (Default = Browser)

  3. Prepare the mobile parameter values in your selected location.

Mobile parameter values

Supported parameters and values include:

Browser

One of the following:

  • CHROME_EMULATOR. For the Chrome emulator.

  • MOBILE_HPEWEB. For the UFTM Browser Web app.

    Note: If you use this value, ensure that the UFTM Browser app is installed on your device before beginning the test.

  • MOBILE_CHROME. For the native Chrome browser on Android.

  • MOBILE_SAFARI. For the native Safari browser on iOS.

browser_identifier

To use the UFTM Browser Web app, define this as com.hp.mobileweb.

To use a native mobile browser, leave this parameter blank and set the device_ostype parameter. This enables UFT Mobile to automatically define the browser identifier.

device_manufacturer

Defines the device's manufacturer.

Leave this value blank for an iteration running with the Chrome emulator.

device_model

Defines the device name.

Device names must be identical to those listed in the Device dropdown list in the Record and Run Settings dialog box.

When working with the Chrome emulator, you can modify these values in the EmulatedDevices.xml file. For details, see Configure your emulated devices.

device_ostype

One of the following:

  • Android

  • iOS

Mandatory if the Browser value is set to MOBILE_CHROME, MOBILE_SAFARI, or MOBILE_HPEWEB.

device_osversion Defines the device's operating system version.
device_source

Defines the source lab for the device. One of the following:

  • UFTM for UFT Mobile (MC supported for backward compatibility)

  • AWS

host

Defines the device ID, as defined in UFT Mobile.

Required for running the test on mobile devices (as opposed to on the Chrome emulator).

Back to top

Configure your emulated devices

Edit the EmulatedDevices.xml file to specify specific devices to be used for the Chrome emulator. This file is located in the <UFT One installation folder/bin> directory.

Specify the following attributes for each emulated device:

<Name> The device name that is displayed in the list of devices in the Record and Run Settings.
<width> and <height>

The width and height of the device when emulated by Chrome.

The value must be a positive integer.

<deviceScaleFactor>

The number by which to scale the emulated device.

The value must be a positive integer.

<userAgent> The type of browser used for the emulated device
<touch>

Whether or not the emulated device is touch-enabled.

Type: Boolean (True or False)

<mobile>

Whether or not the emulated device is a mobile device.

Type: Boolean (True or False)

<fit>

Whether or not to use the current Chrome browser as the emulator for this device.

Type: Boolean (True or False)

Recommended: False.

Selecting True places the emulated device in the center of the remote access window. The resulting offset can cause a test to fail.

Back to top

Define test run iteration settings

If your test has multiple iterations, you must instruct UFT One how to handle device restart and installation between each iteration of the test.

  1. In UFT One, select File > Settings to open the Test Settings dialog.

  2. In the Mobile Advanced tab of the Test Settings dialog, select the following options according to your needs:

    • Release devices after each iteration or test. Recommended, to make your device available for others when possible.

    • Restart mobile apps between iterations

    • Reinstall mobile apps between iterations

Back to top

See also: