Select device command

Enables selecting a device according to device attributes instead of a specific device ID. For example, specifying an iPad 4 model will randomly select an available iPad 4 device.

When you define multiple parameters (such as Model and OS Version), the command will select a single device that matches all of the defined requirements. Use Select Device when you would like to broaden the range of potential device options according to the specified attributes.

All Select Device parameters accept regular expressions, including wildcards. The parameters are case insensitive.

For more information, see Use the select device command.

Parameters

Name Type Possible values Description

Result variable

Device

 

The variable to receive the device value.

OS

String

Android | iOS | BlackBerry | Symbian | Windows-Mobile | Windows Phone

The name of the device's operating system.

OS version

String

 

The version of the device's operating system.

OS build

String

 

The build number of the operating system of the device requested for allocation.

CPU Arch

String

 

CPU Architecture of the device to select

Manufacturer

String

  The manufacturer of the device. For example: Samsung, Apple, Nokia, HTC

Model

String

 

The model of the device. For example: iPhone-5S, Galaxy S III, Xperia Z, 9100, HTC One

Resolution

String

 

Resolution of the device screen.

Network

String

 

The device's network.

Location

String

 

The location of the device.

Description

String

 

A description for the device

Automation infrastructure

String

 

Displays the automation infrastructure configured for the OS version running on the device.

For iOS devices values:

  • UIAutomation: Devices running iOS 10-

  • XCUITest: Devices running iOS 10+

For Android devices values:

  • UIAutomator1: Devices running Android 5-

  • UIAutomator2: Devices running Android 5.1+

Automatic operator

String

 

Indicates if the device should supply the operator identity, based on the installed SIM card.

Allocation policy

String

Wait | No wait

The behavior in case the requested device is unavailable, where:

  • Wait keeps the script in 'Pending' until any of the matching devices become available

  • No wait causes the script to fail if none of the matching devices is available

Timeout

Number

 

The waiting time, in minutes, for the device to be available.

This parameter is only relevant when using Wait as the allocation policy.

Result data table

DataTable

 

A DataTable that returns the selected devices. The DataTable should have a single column of type Handset. To use the DataTable with other functions (such as device info), in the Device ID parameter, select the DataTable.

For more information on DataTables, see Create DataTables.

Persona

String

Georgia | Peter | Ross | Sam | Sara | Empty

The name of a pre-defined persona.

Persona repository file

Media

 

The repository key of a defined persona json file in the media repository.

When using commands that utilize files from the repository, the paths to the files are specified as repository keys. A repository key consists of the subarea and the path to the file.

For example, to specify a file called myImage.jpg stored in the images folder located in the PRIVATE subarea, specify the key as PRIVATE:images/myImage.jpg.

You can select a file that already resides in the Perfecto repository or select a file from your computer that is then uploaded to the Perfecto repository. To learn more about the Perfecto repository, see Manage the repository. Click the Select media link, browse to the file, and then click SELECT.

Example: PRIVATE:Personas/MyPersona.json

Operability score

String

Error Free | High Score | Medium Score | Low Score | Best First | Any

The Operability Score parameter selects the most stable device that matches the requested filter, where:

  • Best First selects one of the devices with the highest operability score available. If the command was requested to populate a data table, it will populate the devices sorted according the operability score.

  • Error Free selects one of the devices with no operability error. If the command was requested to populate a data table, it will populate the data table only with devices with no operability error.

  • Any does not select or sort according to the operability score.

Comment

String

 

Adds a comment to the script

On-fail Result*

Condition

Ignore | Break | Continue | Abort | Catch

The behavior when the command fails.

* Mandatory parameter