MobileApps Collection

Supported in UFT One versions 14.03 and higher.

A collection of mobile apps used during a record or run session.

Before using this collection, you must have:

  • A UFT One connection to Mobile Center / UFT Mobile / Digital 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 UFT One version.

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

Object Model

Properties

Count Property

The number of mobile apps in the collection.

Item Property

Returns the specified MobileApp object. For details, see MobileApp Object.

Example

Define the mobile app used in your test

'Create a QTP object
Set QTP = CreateObject("QuickTest.Application")
QTP.Launch
QTP.Visible = True
 
'Open a UFT One Test
QTP.Open "C:\Users\Administrator\Desktop\scripts\Android\UFT_Replay_Android_Native_OOA_Script", TRUE 
'Set the UFT One test path
Set qtMobileLauncher = QTP.Test.Settings.Launchers("Mobile")
qtMobileLauncher.Lab = "DigitalLab" 'UFT One 2023 or earlier: "MobileCenter"
qtMobileLauncher.Device.OS = "Android"
qtMobileLauncher.Device.OSVersionCriteria = ">=6.0"
set MyExtraApps = qtMobileLauncher.ExtraApps
MyExtraApps.Item(1).Counter = 1
MyExtraApps.Item(1).IsPackaged = "false"
msgbox "App 1 identifier: " & MyExtraApps.Item(1).Identifier
msgbox "App 1 name: " & MyExtraApps.Item(1).Name
msgbox "Before change counter App 3 counter: " & MyExtraApps.Item(1).Counter
'Set the result location
Set qtpResultsOpt = CreateObject("QuickTest.RunResultsOptions")
qtpResultsOpt.ResultsLocation = "C:\Users\Administrator\Desktop\scripts\Android\UFT_Replay_Android_Native_OOA_Script" + "\Results" 'Set the results location
 
'Run the test
QTP.Test.Run qtpResultsOpt
 
'Close UFT One
QTP.Test.Close
QTP.Quit