App Object
Description
A mobile app.
Operations
The sections below list the built-in methods and properties that you can use as operations for the App object.
Note: You can also view a list and descriptions of the App description properties, for use in object repository descriptions, programmatic descriptions, checkpoint and output value steps, and as argument values for the GetTOProperty and GetROProperty methods.
Methods
Check | Checks whether the actual value of an item matches the expected value. |
CheckProperty | Checks whether the specified object property achieves the specified value within the specified timeout. |
ChildObjects | Returns the collection of child objects contained within the object. |
GetAllROProperties | Returns the collection of properties and current values from the object in the application. |
GetROProperty | Returns the current value of the specified description properties from the object in the app. |
GetTOProperties | Returns the collection of properties and values used to identify the object. |
GetTOProperty | Returns the value of the specified description property from the test object description. |
Highlight | Highlights the object in the application. |
Kill | Closes the app. |
Launch | Launches the app. |
Output | Retrieves the current value of an item and stores it in a specified location. |
RefreshObject | Instructs UFT One to re-identify the object in the app the next time a step refers to this object. |
SetBarcodeSimulationMode | Determines whether barcode or QR code simulation is enabled. |
SetAuthenticationSimulationMode | Determines whether fingerprint or facial recognition authentication simulation is enabled. |
SetTOProperty | Sets the value of the specified description property in the test object description. |
SimulateBarcodeByData | Simulates the barcode or QR code by providing the text that barcode holds and the barcode format. |
SimulateBarcodeByImage | Simulates the barcode or QR code by identifying its image. |
SimulateCamera | Starts camera simulation. |
Simulates an authentication simulation action, including both fingerprint and facial recognition. | |
SimulateVideo | Starts video camera simulation. |
StopSimulateVideo | Stops camera simulation. |
StopSimulateCamera | Stops video camera simulation. |
ToString | Returns a string that represents the current test object. |
Uninstall | Uninstalls the app from the device. |
WaitProperty | Waits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step. |
Kill Method
Description
Stops the app and all its processes.
Syntax
object.Kill
Return Type
None
Example
'The following example stops the Advantage Shopping app on the device being tested. Device("Device").App("Advantage Shopping").Kill
Launch Method
Description
Launches the app.
Syntax
object.Launch [InstallApp], [RestartApp]
Arguments
Parameter | Description |
---|---|
InstallApp |
Optional. A InstallAppBehavior Value. The installation behavior for the selected mobile app. Possible values:
Default value = 0 |
RestartApp |
Optional. A RestartAppBehavior Value. The restart behavior for the selected mobile app. Possible values:
Default value = 0 |
Return Type
None
SetBarcodeSimulationMode Method
Description
Determines whether barcode or QR code simulation is enabled.
Syntax
object.SetBarcodeSimulationMode([enableSimulation])
Arguments
Parameter | Description |
---|---|
enableSimulation | A boolean value:
|
Return Type
None
IMPORTANT
This method is supported only on packaged apps.
Example
'The following enables barcode or QR code simulation on the app.
Device("Device").App("BarcodeDialog").SetBarcodeSimulationMode(True)
SetAuthenticationSimulationMode Method
Description
Determines whether fingerprint or facial recognition authentication simulation is enabled.
Syntax
object.SetAuthenticationSimulationMode ([enableSimulation])
Arguments
Parameter | Description |
---|---|
enableSimulation | A boolean value:
|
Return Type
None
IMPORTANT
This method is supported only on packaged apps.
Example
'The following enables authentication simulation on the app.
Device("Device").App("FingerprintDialog").SetAuthenticationSimulationMode (True)
SimulateBarcodeByData Method
Description
Simulates the barcode or QR code by providing the text that barcode holds, such as a URL, and the data format.
Supported only on iOS.
Syntax
object.SimulateBarcodeByData [Data], [Format]
Arguments
Parameter | Description |
---|---|
Data | Required. A string value. The text that the barcode or QR code holds, such as a URL. |
Format | Required. A string value. Format supported by Digital Lab (UFT Mobile). For details, see the Digital Lab (UFT Mobile) Help. |
Return Type
None
IMPORTANT
This method is supported only on packaged apps.
SimulateBarcodeByImage Method
Description
Simulates the barcode or QR code by identifying its image.
Syntax
object.SimulateBarcodeByImage ReferenceName
Arguments
Parameter | Description |
---|---|
ReferenceName | Required. A string value. The reference file name of the uploaded barcode or QR code image, including the extension. For example: barcode.png |
Return Type
A boolean value indicating success of the simulation.
IMPORTANT
This method is supported only on packaged apps.
SimulateCamera Method
Description
Starts camera simulation.
Syntax
object.SimulateCamera ReferenceName, [SimulateCount]
Arguments
Parameter | Description |
---|---|
ReferenceName | Required. A string value. The reference name for the files to replace the camera output. These files must be uploaded before the test run with the same name. |
SimulateCount |
Optional. An integer value. The number of times for the simulation. |
Return Type
A boolean value indicating success of the simulation.
IMPORTANT
This method is supported only on packaged apps.
SimulateAuthentication Method
Description
Simulates an authentication simulation action, including both fingerprint and facial recognition.
- This method is not supported for recording.
- Facial recognition is supported only on iOS devices.
Syntax
object.SimulateAuthentication([Result], [ResultInfo])
Arguments
Parameter | Description |
---|---|
Result | Required. A string value giving the result of the authentication. One of the following:
|
ResultInfo | Optional. A string value giving more details about the result. Not relevant for Success results. One of the following: Failure:
Cancel
|
Return Type
A string indicating the success of the simulation, and any failure reasons if relevant.
IMPORTANT
This method is supported only on packaged apps.
Example
'The following step shows a successful authentication simulation.
Device("Device").App("FingerprintDialog").SimulateAuthentication"Success"
'The following step shows a failed fingerprint authentication simulation due to a lockout.
Device("Device").App("FingerprintDialog").SimulateAuthentication"Failure", "Lockout"
SimulateVideo Method
Description
Starts video simulation.
Syntax
object.SimulateVideo ReferenceName, [SimulateCount]
Arguments
Parameter | Description |
---|---|
ReferenceName | Required. A string value. The reference name for the files to replace the camera output. These files must be uploaded before the test run with the same name. |
SimulateCount |
Optional. An integer value. The number of times for the simulation. |
Return Type
A boolean value indicating success of the simulation.
IMPORTANT
This method is supported only on packaged apps.
StopSimulateCamera Method
Description
Stops camera simulation.
Syntax
object.SimulateCamera
Return Type
None
IMPORTANT
This method is supported only on packaged apps.
StopSimulateVideo Method
Description
Starts camera simulation.
Syntax
object.StopSimulateVideo
Return Type
None
IMPORTANT
This method is supported only on packaged apps.
Uninstall Method
Description
Uninstalls the app from the device.
Syntax
object.Uninstall
Return Type
None
Example
'The following example uninstalls the Advantage Shopping app from the device being tested. Device("Device").App("Advantage Shopping").Uninstall
See also: