Supported Commands
The Mobilewright engine is in beta and supports a part of the WebdriverIO API. This page lists what works today. A command that is not listed fails with:
The command "<name>" is not supported by @wdio/mobilecli-driver
The name in that message is the protocol command that WebdriverIO sent, which can differ from the command in your test. For example $('~login').click({ x: 10 }) reports performActions.
Supported​
| WebdriverIO | Notes |
|---|---|
$(selector), $$(selector) | Accessibility id (~), id (id=) and class name, see Selectors. |
click(), tap() | A tap in the middle of the element, without options. |
setValue(), addValue(), clearValue() | string and number values. { mask: true } works. |
getText(), getValue() | See Read an element. |
isDisplayed(), isEnabled() | Do not wait. |
waitForExist(), waitForDisplayed(), waitForEnabled() | Also with reverse: true. |
browser.hideKeyboard(), browser.isKeyboardShown() | hideKeyboard() takes no strategy. |
browser.getPageSource() | Returns JSON, not XML. |
browser.setTimeout({ implicit }) | Sets the timeout of the engine, see Timeouts. |
expect matchers | The matchers that use these commands, such as toHaveText(), toBeDisplayed() and toBeEnabled(). |
Not supported yet​
These work with Appium and are not built for the Mobilewright engine yet:
| Area | Examples |
|---|---|
| Selectors | XPath, -ios predicate string, -ios class chain, -android uiautomator, chained $('~list').$('~item') |
| Gestures | swipe(), scrollIntoView(), longPress(), pinch(), zoom(), dragAndDrop(), click() and tap() with options, browser.tap({ x, y }) |
| Screen | takeScreenshot(), saveScreenshot(), orientation |
| Apps during a test | launchApp(), closeApp(), installing or stopping an app. To start an app, use mobilecli:app. |
| Hybrid apps | getContexts(), switchContext(), webviews |
| Sessions | browser.reloadSession(), attaching to a running session |
| Device clouds | Only local devices are supported. Support for device clouds is in progress. |
| Other mobile commands | The other mobile commands and mobile: scripts with browser.execute() |
More commands and selectors are added during the beta. To run a test that needs one of them today, run it with Appium: see Run the same tests with Appium.