String = WaitForDevice(Device, Timeout)
Description
The command gives the ability to choose device for testing dynamically based on query of the devices properties.
It is mandatory to release the device and make it available for other future tests, use the SeeTestAutomation- ReleaseDevice command.
The command returns the device's name.
Parameters
- Device: Search device query.
- Timeout: Timeout in milliseconds to wait for an available device according to the search query.
Optional properties for queries:
- device added: if device is available on the device list in the user's machine.
- host: IP of the host machine in the SeeTestCloud configuration.
- location: Location of the host machine as set in the SeeTestCloud configuration.
- manufacture
- model: Device model, for example: SM-G935F
- modelName: Device marketing name: for example: Galaxy S7 Edge
- name
- os: Operating system.
- remote: If device is connected through SeeTestCloud or not (values are true/false).
- serialnumber: S/N of the device.
- version: The device's operating system version (for example 4.1.2).
- versionnumber: The device's operating system version number (for example 4.1).
- category: The device category. Currently supported in android devices. possible values- 'WATCH', 'PHONE' or 'TABLET'.
Note: If the device is in the cloud, the command will make a reservation and use the device. However, if the device is already reserved, the command will not be able to reserve the device.
Usage
Command usage: Assigns a device to a test based on a device query. The query is written in XPath syntax.
Example Queries:
- "@added='false' and @location='US' and @manufacture='Samsung' and @os='android' and @version='4.2.2' and @remote='true'"
- "@added='false' and @location='UK' and @manufacture='apple' and @model='iphone/ipod(3/4/5)' and @os='ios' and @remote='false' and @versionnumber='7.0'"
- "@added='false' and @location='UK' and @manufacture='apple' and @model='iphone/ipod(3/4/5)' and @os='ios' and contains(@name, 'iPhone')'"
- "@added='false' and @location='UK' and @manufacture='apple' and @model='iphone/ipod(3/4/5)' and @os='ios' and starts-with(@name, 'iPhone')'"