Appium OSS Supported Capabilities
Capabilities
Capability | Documentation | Supported OS | Comments |
---|---|---|---|
uniqueName | Application Setup | iOS/Android | You can install and launch an App with a unique name. |
reportDisable (report.disable) | Automated Test Reports | iOS/Android | Use this capability to choose if a report is generated. |
installOnlyForUpdate | Application Setup | iOS/Android | Re-installs an application only if an older version already installed on the device. |
buildVersion / releaseVersion / appVersion | Application Setup | iOS/Android | Installs and launches the app by build version/release version. |
instrumentApp | Application Setup | iOS/Android | Instrument the application. This is needed for extra capabilities (simulateCapture for example). |
DeviceQuery | Device Setup | iOS/Android | Instead of using "udid" capability you can run queries for cloud devices. |
appiumVersion | iOS/Android | Choose the Appium Server version to be used for the execution. To see which versions are supported, see Appium Version Capability. | |
releaseDevice | Device Setup | iOS/Android | Gives the capability to not release a device after performing driver.quit(); Default: true In case the device is already reserved or uses future reservations when the test starts then the releaseDevice capability does not have any effect and the device is not be released. |
dontGoHomeOnQuit | iOS/Android | The device remains in the last left state even after ending the test. Default: false For iOS: In the case of starting a new session, launch the app with noReset=true (from appium version 1.22.0 and above) to continue from the same state. | |
commandScreenshot | iOS/Android | In Video Report, takes a screenshot also before and after every action. Default: false | |
AudioReport | Attaching Audio to Video Report | iOS/Android | Attaches a device audio to the video report. |
selfHealing | Appium Self-Healing | iOS/Android | Enable or disable self-healing during session. Default: false |
Code Examples
info
Replace <server> with the appropriate URL.
- Public Continuous Testing Cloud - https://cloud.seetest.io/wd/hub/.
- Dedicated Continuous Testing Cloud environment - Your own domain. For example: https://company.experitest.com/wd/hub/
- On-premises Continuous Testing Cloud environment - Your designated URL. For example: https://company.com/wd/hub
iOS Native Test Expand source
protected AppiumDriver<MobileElement> driver = null;//driver
DesiredCapabilities dc = new DesiredCapabilities();
@Before
public void setUp() throws MalformedURLException {
//Appium Open Source Have to capabilities
dc.setCapability("testName",<Your Test Name>);//set the test name
dc.setCapability("platformName", "iOS");//set platform(iOS/Android)
dc.setCapability("deviceName", "auto");//set the device name
dc.setCapability(MobileCapabilityType.AUTOMATION_NAME, "XCUITest");//automation name(XCUITest for iOS)
dc.setCapability(MobileCapabilityType.APP, <Your APP>);//for install
//Experitest capabilities
dc.setCapability("accessKey", <your accessKey>);// cloud Authorization
dc.setCapability("appiumVersion", <Appium Version>);//Desired Appium version for example 1.16.0-p1
driver = new IOSDriver<IOSElement>(new URL("<server>), dc);//init driver
}
@Test
public void Test(){
//Your Test Goes Here
}
@After
public void tearDown() {
driver.quit();
}
iOS Web Test Expand source
protected AppiumDriver<MobileElement> driver = null;//driver
DesiredCapabilities dc = new DesiredCapabilities();
@Before
public void setUp() throws MalformedURLException {
//Appium Open Source Have to capabilities
dc.setCapability("testName",<Your Test Name>);//set the test name
dc.setCapability("platformName", "iOS");//set platform(iOS/Android)
dc.setCapability("deviceName", "auto");//set the device name
dc.setCapability(MobileCapabilityType.AUTOMATION_NAME, "XCUITest");//automation name(XCUITest for iOS)
dc.setCapability(MobileCapabilityType.BROWSER_NAME, BrowserType.SAFARI);//for mobile web
//Experitest capabilities
dc.setCapability("accessKey", <your accessKey>);// cloud Authorization
dc.setCapability("appiumVersion", <Appium Version>);//Desired Appium version for example 1.16.0-p1
driver = new IOSDriver<IOSElement>(new URL("<server>), dc);//init driver
}
@Test
public void test()
{
driver.get("http://www.google.com");
//your test goes here
}
@After
public void tearDown(){
driver.quit();
}
Android Native Test Expand source
protected AppiumDriver<MobileElement> driver = null;//driver
protected DesiredCapabilities dc = new DesiredCapabilities();
private String deviceSN = <device serial number>;//device to run on
private String appiumVersion = "1.16.0-p2";//appium version to run
@Before
public void before() throws MalformedURLException {
//Appium capabilities
dc.setCapability("udid", deviceSN);
dc.setCapability("testName", <your test name>);
dc.setCapability("app","cloud:" + <app-package>);
dc.setCapability("automationName", "UiAutomator2");
dc.setCapability("platformName", "Android");
//Experitest capabilities
dc.setCapability("accessKey", <your accessKey>);// cloud Authorization
dc.setCapability("appiumVersion", appiumVersion);//Appium server version
driver = new AndroidDriver<>(new URL("<server>), dc);
}
@Test
public void test() {
//your test goes here
}
@After
public void tearDownAfterAll() {
if (driver != null) {
driver.quit();
}
}
Android Web Test Expand source
protected AppiumDriver<MobileElement> driver = null;//driver
protected DesiredCapabilities dc = new DesiredCapabilities();
private String deviceSN = <device serial number>;//device to run on
private String appiumVersion = "1.16.0-p2";//appium version to run
@Before
public void before() throws MalformedURLException {
//Appium capabilities
dc.setCapability("udid", deviceSN);
dc.setCapability("testName", <your test name>);
dc.setCapability(MobileCapabilityType.BROWSER_NAME, "Chrome");
dc.setCapability("automationName", "UiAutomator2");
dc.setCapability("platformName", "Android");
//Experitest capabilities
dc.setCapability("accessKey", <your accessKey>);// cloud Authorization
dc.setCapability("appiumVersion", appiumVersion);
driver = new AndroidDriver<>(new URL("<server>"), dc);
}
@Test
public void test() {
driver.get("https://www.experitest.com");
driver.findElement(By.id("to-about-section")).click();
driver.findElement(By.id("firstname")).sendKeys("user1");
driver.findElement(By.id("lastname")).sendKeys("last1");
driver.findElement(By.id("email")).sendKeys("myemail@company.com");
driver.findElement(By.id("password")).sendKeys("pass");
}
@After
public void tearDownAfterAll() {
if (driver != null) {
driver.quit();
}
}