SoftwareTestPilot
All discussions
Sofia NovakJul 15

Appium 2: desiredCapabilities vs W3C options — what changed?

Old scripts use desiredCapabilities and Appium 2 keeps warning. What is the correct 2026 shape?

appiumcapabilities
Related learningExplore Academy skill paths

1 answer

Accepted solution

Sofia NovakJul 16

They are the same concept, different API generations. `DesiredCapabilities` is the legacy JSON-blob style from the JSONWP protocol; the `Options` classes (`UiAutomator2Options`, `XCUITestOptions`) are the typed W3C-compliant replacement introduced in Appium 2.

java
UiAutomator2Options options = new UiAutomator2Options()
    .setPlatformName("Android")
    .setDeviceName("Pixel_7")
    .setApp("/apps/demo.apk")
    .setAutoGrantPermissions(true);
AndroidDriver driver = new AndroidDriver(new URL("http://127.0.0.1:4723"), options);

On Appium 2 every non-standard capability must be vendor-prefixed (`appium:app`, `appium:deviceName`) — the Options classes add that prefix for you, which is the main reason to migrate. `DesiredCapabilities` still compiles but is deprecated and will throw "invalid or unsupported capability" errors the moment you forget a prefix. New projects should use Options only.