MobileLauncher Object

Represents the Mobile tab of the Record and Run Settings dialog box, which defines the devices and apps used for during a record or run session.

Before using this test object, you must have:

  • A connection set up to Mobile Center / UFT Mobile / Digital Lab / OpenText Functional Testing Lab.

  • The following Record and Run Settings defined:

    • On the Mobile tab, select Use Mobile Center, Use UFT Mobile, or Use mobile device depending on your product version.

    • On the Web tab, select Use settings on the Mobile tab.

Object Model

Methods

EnableWebSettingForMobile Method

Defines the settings on the Web tab of the Record and Run Settings for mobile device testing.

Required for running web tests on mobile devices.

Properties

Device Property

Defines the device used during the test using the MobileDevice Object.

ExtraApps Property

Defines a non-system mobile app to be used during the test using the MobileApps Collection.

InstallApps Property

Defines whether the selected mobile apps are installed on the device at the start of the record or run session.

Lab property

Defines the mobile device lab to use during a record or run session.

LaunchOnStart Property

A MobileApp Object representing the app currently defined in the Record and Run Settings to launch at the start of your record or run session.

RestartApps Property

Defines whether the selected mobile apps are restarted on the device at the start of the record or run session.

TrackCPUMetric Property

Determines whether the device's CPU is tracked during your run session.

TrackFreeMemoryMetric Property

Determines whether the device's free memory is tracked during the run session.

TrackLogs Property

Determines whether the device's logs are tracked during the run session.

TrackMemoryMetric Property

Determines whether the device's memory is tracked during the run session.

UninstallApps Property

Defines whether the selected mobile apps are uninstalled on the device at the end of the record or run session.

Examples

Set the Mobile Settings in the Record and Run Settings dialog box

The following script uses the EnableWebSettingForMobile method to define the settings on the Web tab of the Record and Run Settings dialog.

Dim QTP
Set QTP = CreateObject("QuickTest.Application")
QTP.Launch
QTP.Visible = True
QTP.Open "C:\Users\admin\Documents\UFT One\AOMMobileTest", TRUE 'Set the QTP test path
Set qtMobileLauncher = QTP.Test.Settings.Launchers.Item("Mobile")
qtMobileLauncher.Lab = "DigitalLab"     'UFT One 2023 or earlier: "MobileCenter"
qtMobileLauncher.Device.ID = "bb0ce5eb_48da_44e7_bea9_84bad81abc71"
qtMobileLauncher.Device.OS = "Android"
qtMobileLauncher.EnableWebSettingForMobile
Set qtMobileLauncher = Nothing
Set QTP = Nothing

Specify the app to launch at the start of your test

The following script starts the app with the counter of 1 at the start of the test.

Dim QTP
Set QTP = CreateObject("QuickTest.Application")
QTP.Launch
QTP.Visible = True
QTP.Open "C:\Users\admin\Documents\UFT One\AOMMobileTest", TRUE 'Set the QTP test path
Set qtMobileLauncher = QTP.Test.Settings.Launchers.Item("Mobile")
Set launchApp = qtMobileLauncher.LaunchOnStart
launchApp.IsPackaged = True
launchApp.Counter = 1
Set qtMobileLauncher = Nothing
Set QTP = Nothing