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

Common Method Check Checks whether the actual value of an item matches the expected value.
Common Method CheckProperty Checks whether the specified object property achieves the specified value within the specified timeout.
Common Method ChildObjects Returns the collection of child objects contained within the object.
Common Method GetROProperty Returns the current value of the specified description properties from the object in the app.
Common Method GetTOProperties Returns the collection of properties and values used to identify the object.
Common Method GetTOProperty Returns the value of the specified description properties from the test object description.
Kill Closes the app.
Method Launch Launches the app.
Common Method Output Retrieves the current value of an item and stores it in a specified location.
Common Method RefreshObject Instructs UFT to re-identify the object in the app the next time a step refers to this object.
Method SetBarcodeSimulationMode

Determines whether barcode or QR code simulation is enabled.

SetAuthenticationSimulationMode

Determines whether fingerprint or facial recognition authentication simulation is enabled.

Common Method SetTOProperty Sets the value of the specified description properties in the test object description.
Method SimulateBarcodeByData Simulates the barcode or QR code by providing the the text that barcode holds and the barcode format.
Method SimulateBarcodeByImage Simulates the barcode or QR code by identifying its image.
SimulateCamera Starts camera simulation.

SimulateAuthentication

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.
Common Method ToString Returns a string that represents the current test object.
Uninstall

Uninstalls the app from the device.

Common Method WaitProperty Waits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step.

Back to top

Kill Method

Description

Stops the app and all its processes.

Syntax

object.Kill

Return Type

None

Example

Back to top

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:

  • DefaultInstallBehavior: Installs the app according to the settings in the Record and Run Settings dialog box.
  • DoNotInstall: Ignores the Record and Run Settings and does not install the app on the mobile device.
  • Install: Ignores the Record and Run Settings and installs (or reinstalls) the app on the mobile device.

Default value = 0
RestartApp Optional. A RestartAppBehavior Value.

The restart behavior for the selected mobile app.

Possible values:

  • DefaultRestartBehavior: Restarts the app according to the settings in the Record and Run Settings dialog box.
  • DoNotRestart: Ignores the Record and Run Settings and does not restart the app on the mobile device.
  • Restart: Ignores the Record and Run Settings and restarts the app on the mobile device.

Default value = 0

Return Type

None

Back to top

SetBarcodeSimulationMode Method

Description

Determines whether barcode or QR code simulation is enabled.

Syntax

object.SetBarcodeSimulationMode([enableSimulation])

Arguments

Parameter Description
enableSimulation

A boolean value:

  • True. Barcode or QR code simulation is enabled. (Default)
  • False. Barcode or QR code simulation is disabled.

Return Type

None

Example

Back to top

SetAuthenticationSimulationMode Method

Description

Determines whether fingerprint or facial recognition authentication simulation is enabled.

Syntax

object.SetAuthenticationSimulationMode ([enableSimulation])

Arguments

Parameter Description
enableSimulation

A boolean value:

  • True. Authentication simulation is enabled.
  • False. Authentication simulation is disabled.

Return Type

None

Example

Back to top

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 Mobile Center. For details, see the Mobile Center Help.

Return Type

None

Back to top

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.

Back to top

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.

Back to top

SimulateAuthentication Method

Description

Simulates an authentication simulation action, including both fingerprint and facial recognition.

Syntax

object.SimulateAuthentication([Result], [ResultInfo])

Arguments

Parameter Description
Result

Required. A string value giving the result of the authentication.

One of the following:

  • Success
  • Failure
  • Cancel
ResultInfo

Optional. A string value giving more details about the result.

Not relevant for Success results.

One of the following:

Failure:

  • FingerIncomplete (Android only)
  • Lockout
  • NoAuthenticationRegistered (iOS only)
  • NotRecognized
  • SensorDirty (Android only)

Cancel

  • System
  • User (iOS and Android 8.1 or higher)

Return Type

A string indicating the success of the simulation, and any failure reasons if relevant.

Example

Back to top

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.

Back to top

StopSimulateCamera Method

Description

Stops camera simulation.

Syntax

object.SimulateCamera

Return Type

None

Back to top

StopSimulateVideo Method

Description

Starts camera simulation.

Syntax

object.StopSimulateVideo

Return Type

None

Back to top

Uninstall Method

Description

Uninstalls the app from the device.

Syntax

object.Uninstall

Return Type

None

Example

Back to top

See also: