Assigning a test variable to an object’s property

You can assign a new value to a test variable and set it to a Mobile object’s property.

Before you begin

To be able to create a variable assignment, you must first declare a variable. This task is explained in the Declaring and assigning test variables page. Then you can set a value for the object’s property, it will be used when the variable will be executed in the test.

You can create variable assignments in the tests which are created from mobile or Web-based apps if the Web UI actions and elements for hybrid apps is activated, see Activating web UI actions.

Procedure

To create a variable assignment and set it the value to a Mobile object’s property:

  1. Open the test, and in the Test Contents area, select a test element.
  2. Select Insert > Variable Assignment, which inserts the assignment before the selected element. The Test Editor window opens and lists the variables available to the test.
  3. Select the variable that you are assigning a value to, and, in the Set to box in the Test Element Details area, select Mobile/Web object’s property, set the value for the variable to Mobile object’s property. Select a graphic object and the object’s property. The values of the properties are different for Web UI apps and Android apps.
  4. Save the test. A set statement is added to the test, with the value you chose.

The other way is to assign a variable to an object select in the Data Mobile view but the variable must be created before:

  1. In the Mobile Data view, from the Screen Capture tab or the Elements tab, right-click an object and select Create variable assignment from the element selected. In the wizard that opens, select a variable and click OK. The variable is added to the test suite.

Feedback