Open topic with navigation
Represents the devices available in the Mobile tab of the Record and Run Settings dialog box.
Record and Run Settings
You must have the following Record and Run Settings defined before using this test object:
Then, use the MobileDevice object to switch between working with a specific device vs reserving a device by capabilities.
If the Record and Run Settings are currently defined to ...
... Set your properties as follows:
|Use a specific device (by device ID)||Use the ManufacturerAndModel or the OSVersionCriteria properties to switch to reserving a device by capability.|
|Reserve a device by capability||
Set the ID property to switch to using a specific device by device ID.
In such cases, do not use the ManufacturerAndModel and OSVersionCriteria properties in your script.
After switching, any properties irrelevant to the current settings are set to empty. The OS property value is always kept.
Defines the device ID. Required for selecting a specific device.
Defines the device's manufacturer and model. Optional for selecting a device by capability.
Defines the device's operating system. Required for selecting a specific device, or for selecting a device by capability.
Defines the device's operating system version. Optional for selecting a device by capability.
Read-only. Defines the device lab used in the record or run session. Optional for selecting a device by capability.
'Create a QTP object
Set QTP = CreateObject("QuickTest.Application")
QTP.Visible = True
'Open a UFT test
QTP.Open "C:\Users\Administrator\Desktop\scripts\Android\UFT_Replay_Android_NativeBrowser", TRUE 'Set the UFT test path
Set qtMobileLauncher = QTP.Test.Settings.Launchers("Mobile")
qtMobileLauncher.Lab = "SRF"
qtMobileLauncher.Device.ID = "N2F4C15923006550"
qtMobileLauncher.Device.OS = "Android"
'Set test options
qtMobileLauncher.InstallApps = true
qtMobileLauncher.RestartApps = true
qtMobileLauncher.UninstallApps = false
qtMobileLauncher.TrackCPUMetric = true
qtMobileLauncher.TrackMemoryMetric = true
qtMobileLauncher.TrackFreeMemoryMetric = true
qtMobileLauncher.TrackLogs = true
'Set result location
Set qtpResultsOpt = CreateObject("QuickTest.RunResultsOptions")
qtpResultsOpt.ResultsLocation = "C:\Users\Administrator\Desktop\scripts\Android\UFT_Replay_Android_NativeBrowser" + "\Results" 'Set the results location
'Run the test