[ Bug]: Appium protocol commands are not available in non-mobile Appium sessions
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
9.31.7 (plain webdriver, not webdriverio)
Node.js Version
24.20.0
Mode
WDIO Testrunner
Which capabilities are you using?
{
"platformName": "mac",
"appium:automationName": "safari"
}What happened?
When creating an Appium-based non-mobile session (for example, using one of Appium's browser drivers like chromium/gecko/safari), no Appium protocol commands are available, even though many commands in this protocol are still supported in a session like this (for example, retrieval of settings/capabilities/commands/extension methods/etc.).
Direct curl calls to Appium endpoints work as expected - the respective commands are simply not available on the WDIO level.
What is your expected behavior?
I expect all Appium protocol methods to be accessible in any Appium session, regardless of whether it is mobile or not.
With the context of previous discussions (https://github.com/webdriverio/webdriverio/issues/13947, https://github.com/webdriverio/webdriverio/issues/14140), while it is true that not all Appium protocol methods are supported by all drivers, I would not expect WDIO to know which driver supports which commands, especially considering the existence of multiple third-party Appium drivers. Therefore I think it's better for WDIO to allow all protocol commands, and if the driver does not support a command, simply return the error coming from the driver.
The current implementation appears to only include the Appium protocol commands if the session is determined to be a mobile session (driver.isMobile), in webdriver/src/utils.ts. In turn, isMobile returns false for browser-based Appium sessions, in wdio-utils/src/envDetector.ts.
To remedy this, I would probably recommend adding a new isAppium top-level property, which would return true if the appium:automationName capability is present and populated, regardless of its value. Then update the protocol inclusion check to use isAppium instead of isMobile.
How to reproduce the bug.
- Install Appium and the
safaridriver - Start a WDIO session using the above capabilities
- Observe that Appium protocol methods such as
getAppiumCommandsare not available
Relevant log output
N/ACode of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues
Source: webdriverio/webdriverio