Declaring test variables to select a mobile device
To be able to launch subsequent tests in the same logical flow (session) from the same devices, you must select a variable including a reserved variable name and selection criteria related to one or multiple devices.
About this task
Procedure
-
In the Test Navigator, browse to the test and double-click
it.
The test opens.
-
To create a container
for the test variables that you create in a test:
-
To declare a variable in a test:
-
Assign a specific value to the variable and initialize
the variable:
- Select Text
- Enter a selection sentence to assign a variable value to a text string. Enter selection strings including a devices property, followed by an operator value, propertys value and a comma separating each string. For more details on the main device properties you can use and on the syntactic rules, see the Variable selection values topic.
Results
The variable can then be initialized from some external source (a dataset, tests from an IBM® Engineering Test Management test suite, or tests from the same user in compound tests containing one or more mobile tests. It can also be set within a tests execution with a variable assignment action from any data source, including a data correlation reference, custom code, built-in function, dataset, or string constant. As a result, successive tests in the same session will then be sure to run on the same actual devices.
- The Mobile_Device_Selection variable content is checked to get the device ID
- The device is reused if it is still applicable to the app that
must be launched. Conditions:
- The device operating system must be the same as the operating system of the application to be launched.
- The tester app is installed or can be installed without user intervention.