Appium "Failed to create session ... W3C capabilities" in CI
Appium 2 only accepts W3C-format capabilities. A client still sending the old JSON Wire Protocol shape, or unprefixed vendor capabilities, gets rejected before any device is touched.
What this error means
Session creation fails with "Failed to create session" and a message about the request not being in the W3C standard format, or about capabilities missing the appium: prefix.
Failed to create session. The 'desiredCapabilities' object is not a valid W3C
capabilities object. Some capabilities require the 'appium:' prefix:
platformVersion, deviceName, appCommon causes
An old client sending JSONWP capabilities
A pre-W3C client library sends desiredCapabilities in the legacy shape that Appium 2 no longer accepts.
Vendor capabilities missing the appium: prefix
Under W3C, non-standard keys like deviceName or app must be prefixed appium:, or the object is rejected as invalid.
How to fix it
Prefix vendor capabilities and send W3C format
- Add the
appium:prefix to every non-standard capability. - Send capabilities under
alwaysMatch/firstMatch, notdesiredCapabilities. - Upgrade the client library to a version that speaks W3C.
{
"alwaysMatch": {
"platformName": "Android",
"appium:deviceName": "emulator-5554",
"appium:app": "/path/app.apk"
},
"firstMatch": [{}]
}Upgrade the Appium client binding
Modern WebdriverIO, Appium-Python-Client, and java-client releases emit W3C capabilities by default; upgrade the one your suite uses.
How to prevent it
- Keep the Appium client library current so it defaults to W3C.
- Prefix all vendor capabilities with
appium:. - Do not hand-build
desiredCapabilitiespayloads.