Created
October 25, 2017 16:55
-
-
Save sauceaaron/18fc44c5c418db6964a263341a6ecbff to your computer and use it in GitHub Desktop.
Setting DesiredCapabilities to specify a mobile device
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // You can specify a specific private device with the "deviceName" capability: | |
| desiredCapabilities.setCapability("deviceName", "Samsung_Galaxy_S7_lowes_us"); | |
| // You can specify more general patform settings with "platformName" and "platformVersion": | |
| desiredCapabilities.setCapability("platformName", "Android"); | |
| desiredCapabilities.setCapability("platformVersion", "7"); | |
| desiredCapabilities.setCapability("platformName", "iOS"); | |
| desiredCapabilities.setCapability("platformVersion", "11.0.2"); | |
| // For IOS 11 remember that "appiumVersion" should be 1.7.1 or greater | |
| desiredCapabilities.setCapability("appiumVersion", "1.7.1"); | |
| // You can also specify other device groups by setting "phoneOnly", "tabletOnly", or "privateDevicesOnly": | |
| desiredCapabilities.setCapability("phoneOnly", "true"); | |
| desiredCapabilities.setCapability("tabletOnly", "true"); | |
| desiredCapabilities.setCapability("privateDevicesOnly", "true"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment