Skip to main content

Appium OSS Supported Capabilities

Capabilities

CapabilityDocumentationSupported OSComments
uniqueNameApplication SetupiOS/AndroidYou can install and launch an App with a unique name.
reportDisable (report.disable)Automated Test ReportsiOS/AndroidUse this capability to choose if a report is generated.
installOnlyForUpdateApplication SetupiOS/AndroidRe-installs an application only if an older version already installed on the device.
buildVersion / releaseVersion / appVersionApplication SetupiOS/AndroidInstalls and launches the app by build version/release version.
instrumentAppApplication SetupiOS/AndroidInstrument the application. This is needed for extra capabilities (simulateCapture for example).
DeviceQueryDevice SetupiOS/AndroidInstead of using "udid" capability you can run queries for cloud devices.
appiumVersioniOS/AndroidChoose the Appium Server version to be used for the execution.



To see which versions are supported, see Appium Version Capability.
releaseDeviceDevice SetupiOS/AndroidGives 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.
dontGoHomeOnQuitiOS/AndroidThe 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.
commandScreenshotiOS/AndroidIn Video Report, takes a screenshot also before and after every action.



Default: false
AudioReportAttaching Audio to Video ReportiOS/AndroidAttaches a device audio to the video report.
selfHealingAppium Self-HealingiOS/AndroidEnable or disable self-healing during session.



Default: false

Code Examples

info

Replace <server> with the appropriate URL.

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();
}
}