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 CheckChecks whether the actual value of an item matches the expected value.
Common Method CheckPropertyChecks whether the specified object property achieves the specified value within the specified timeout.
Common Method ChildObjectsReturns the collection of child objects contained within the object.
Common Method GetAllROProperties

Returns the collection of properties and current values from the object in the application.

Common Method GetROPropertyReturns the current value of the specified description properties from the object in the app.
Common Method GetTOPropertiesReturns the collection of properties and values used to identify the object.
Common Method GetTOPropertyReturns the value of the specified description property from the test object description.
Common Method HighlightHighlights the object in the application.
KillCloses the app.
Method LaunchLaunches the app.
Common Method OutputRetrieves the current value of an item and stores it in a specified location.
Common Method RefreshObjectInstructs UFT One 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 SetTOPropertySets the value of the specified description property in the test object description.
Method SimulateBarcodeByDataSimulates the barcode or QR code by providing the text that barcode holds and the barcode format.
Method SimulateBarcodeByImageSimulates the barcode or QR code by identifying its image.
SimulateCameraStarts camera simulation.

SimulateAuthentication

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

SimulateVideoStarts video camera simulation.
StopSimulateVideoStops camera simulation.
StopSimulateCameraStops video camera simulation.
Common Method ToStringReturns a string that represents the current test object.
Uninstall

Uninstalls the app from the device.

Common Method WaitPropertyWaits 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

ParameterDescription
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

ParameterDescription
enableSimulation

A boolean value:

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

Return Type

None

IMPORTANT

This method is supported only on packaged apps.

Example

Back to top

SetAuthenticationSimulationMode Method

Description

Determines whether fingerprint or facial recognition authentication simulation is enabled.

Syntax

object.SetAuthenticationSimulationMode ([enableSimulation])

Arguments

ParameterDescription
enableSimulation

A boolean value:

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

Return Type

None

IMPORTANT

This method is supported only on packaged apps.

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

ParameterDescription
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.

Back to top

SimulateBarcodeByImage Method

Description

Simulates the barcode or QR code by identifying its image.

Syntax

object.SimulateBarcodeByImage ReferenceName

Arguments

ParameterDescription
ReferenceNameRequired. 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.

Back to top

SimulateCamera Method

Description

Starts camera simulation.

Syntax

object.SimulateCamera ReferenceName, [SimulateCount]

Arguments

ParameterDescription
ReferenceNameRequired. 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.

Back to top

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

ParameterDescription
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.

IMPORTANT

This method is supported only on packaged apps.

Example

Back to top

SimulateVideo Method

Description

Starts video simulation.

Syntax

object.SimulateVideo ReferenceName, [SimulateCount]

Arguments

ParameterDescription
ReferenceNameRequired. 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.

Back to top

StopSimulateCamera Method

Description

Stops camera simulation.

Syntax

object.SimulateCamera

Return Type

None

IMPORTANT

This method is supported only on packaged apps.

Back to top

StopSimulateVideo Method

Description

Starts camera simulation.

Syntax

object.StopSimulateVideo

Return Type

None

IMPORTANT

This method is supported only on packaged apps.

Back to top

Uninstall Method

Description

Uninstalls the app from the device.

Syntax

object.Uninstall

Return Type

None

Example

Back to top

See also: