Device Setup
Use Device Setup to select the desired device(s).
Device Setup Properties
| Name | Description | Example (Java) |
|---|---|---|
udid | Unique device identifier. | dc.setCapability(MobileCapabilityType.UDID, "ABCDE12345"); |
platformVersion | Mobile OS version. | dc.setCapability(MobileCapabilityType.PLATFORM_VERSION, "5.0"); |
deviceManufacture | Device manufacturer. | dc.setCapability("deviceManufacturer", "samsung"); |
deviceModel | Device model. | dc.setCapability("deviceModel", "iphone 6"); |
deviceCategory | Device category (for example, PHONE, TABLET). | dc.setCapability("deviceCategory", "PHONE"); |
deviceWithAudio | Enables audio injection/extraction support. Default: false. | dc.setCapability("deviceWithAudio", true); |
deviceQuery | Selects a device using a property-based query. Overrides other device capabilities. | dc.setCapability("deviceQuery", "@os='android' and @manufacture='samsung'"); |
orientation | Starts the session in a specific orientation. Values: landscape, portrait. | dc.setCapability(MobileCapabilityType.ORIENTATION, "landscape"); |
releaseDevice | Releases the device when the session ends. Default: true. Supported for Shared Devices. | dc.setCapability("releaseDevice", false); |
reservationDuration | Sets the device reservation duration in minutes. Supported for Shared Devices. | dc.setCapability("reservationDuration", 60); |
devicePool | Selects the device pool. Values: shared, dedicated, any. Supported for Shared Devices. | dc.setCapability("devicePool", "shared"); |
deviceCleanup | Performs device cleanup after the session. Values: true, false. Default: true. | dc.setCapability("deviceCleanup", false); |
onlyAvailable | Uses only devices that are currently available. | dc.setCapability("onlyAvailable", true); |
configurationProfile | Installs an iOS configuration profile. iOS only. | dc.setCapability("configurationProfile", "ABCD-123-EDF"); |
removeConfigurationProfile | Removes the installed configuration profile on driver.quit(). Default: false. iOS only. | dc.setCapability("removeConfigurationProfile", true); |
setPasscode | Sets a device passcode at session start. iOS only. | dc.setCapability("setPasscode", true); |
Other than UDID, all of the capabilities are just extensions of the deviceQuery capability (for example Audio \ Manufacture). The query constructed is based on the other capabilities provided.
Returned Capabilities
The following list describes Digital.ai Testing specific capabilities that returns with the driver.
The capabilities have the digitalai: prefix.
| Key | Type | Description |
|---|---|---|
| publicModel | string | The public model name of the device |
| cloudDeviceName | string | The device name as it appears in the cloud |
| appBuildVersion | string | The application build version |
| appReleaseVersion | string | The application release version |
| reportUrl | string | The report URL |
| reportTestId | string | The report test id |
| cloudViewLink | string | The cloud view link |
| device.phoneNumber1 | string | The phone number of the device |
| device.phoneNumber2 | string | The phone number of the device |
Code Examples
Replace <server> with the appropriate URL.
- Public Digital.ai Testing Cloud - https://cloud.seetest.io/wd/hub/.
- Dedicated Digital.ai Testing Cloud environment - Your own domain. For example: https://company.experitest.com/wd/hub/
- On-premises Digital.ai Testing Cloud environment - Your designated URL. For example: https://company.com/wd/hub
Setup Device by UDID
These examples demonstrate how to set a capability which will initialize the driver to connect to a device using the device UDID.
Java
DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability(MobileCapabilityType.UDID, "1162000958")
driver = new AndroidDriver<>(new URL("<server>"), dc);
Python
dc = {}
self.dc['udid'] = '1162000958'
self.driver = webdriver.Remote('<server>', self.dc)
C Sharp
DesiredCapabilities dc = new DesiredCapabilities();
dc.SetCapability(MobileCapabilityType.Udid, "1162000958")
driver = new AndroidDriver<>(new URL("<server>"), dc);
Ruby
desired_caps = {
caps: {
udid: '1162000958',
},
appium_lib: {
server_url: '<server>',
}
}
@driver = Appium::Driver.new(desired_caps, true).start_driver
Setup Device by Device Query
These examples demonstrate how to set a capability which initializes the driver to connect to a device using a dynamic query, based on the device characteristics (model and OS).
Java
DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability("deviceQuery", "@os='ios' and contains(@model, 'iphone')");
driver = new IOSDriver<>(new URL("<server>"), dc);
Python
dc = {}
self.dc['deviceQuery'] = "@os='ios' and contains(@model, 'iphone')"
self.driver = webdriver.Remote('<server>', self.dc)
C Sharp
DesiredCapabilities dc = new DesiredCapabilities();
dc.SetCapability("deviceQuery", "@os='ios' and contains(@model, 'iphone')");
driver = new IOSDriver<>(new URL("<server>"), dc);
Ruby
desired_caps = {
caps: {
deviceQuery: "@os='ios' and contains(@model, 'iphone')",
},
appium_lib: {
server_url: '<server>',
}
}
@driver = Appium::Driver.new(desired_caps, true).start_driver