Use the select device command
The select device command selects a device according to device attributes instead of a specific device ID. When running a script, instead of checking each time whether the device under test (DUT) is available, use the Select device command to broaden the range of potential device options. When you select single or multiple attributes (such as Model, OS Version), the device or devices that meet those attributes will be selected.
To learn more about scheduling script executions, see Scheduler - schedule script executions.
Select whether the device works with or without a datatable:
- For installing a new application on a group of devices or for testing on a group of devices, use a datatable.
- If you only need one device that meets specific attributes, a datatable is not required.
Select a device without a datatable
-
In the Select Device command, check the Result Variable parameter.
-
Choose the specific attributes that will be used to select the device.
The following example uses the OS parameter. The OS parameter is defined as a variable (platform), which is defined as Android or iOS. One device will be selected that will have either the Android or iOS operating system.
Select a device with a datatable
-
Create a data table with only one column that is defined as the handset type. Do not add any devices. (Devices already in the datatable will be ignored.)
-
Go to Variables and create a new variable with type = Data table. In the value field, add the datatable you created.
-
Add the Select device command to the script outside of the loop:
-
Select Show Advanced Parameters.
-
Select the Result data table parameter.
-
As the value for this parameter, select the datatable you created.
-
-
Define the loop: