Knowledge check
Nine questions on the decisions you make when writing Appium tests with WebdriverIO. Pick an answer for each, then check them all at once.
1. An old config sets deviceName: 'Pixel 8' and automationName: 'UiAutomator2' without a prefix. Against Appium 3, what happens?
Only W3C standard capabilities such as platformName are unprefixed. Appium-specific keys need appium:, and WebdriverIO 10 also stopped treating unprefixed keys as a mobile session signal.
2. You installed Appium 3 with npm install -g appium and starting an Android session fails immediately. What is the most likely missing step?
Since Appium 2 the server ships with no drivers. Each platform driver is installed separately, and appium driver doctor checks its prerequisites.
3. Which locator is usually the best first choice for an element in a native app that must be tested on Android and iOS?
Accessibility IDs work on both platforms, are fast and survive layout changes. CSS does not apply to native views at all, and absolute XPath is slow and breaks with any layout change.
4. After upgrading to WebdriverIO 10, $('~inputA') throws StrictSelectorError on iOS but works on Android. What is the right fix?
The error means the selector matched more than one element. Opting out hides the ambiguity again; a pause changes nothing. A unique locator fixes the cause.
5. Why is a global implicit wait discouraged in a WebdriverIO suite?
Implicit waits still exist, but WebdriverIO's auto-waiting and explicit waitFor* commands cover the same need with clearer behaviour. Mixing both makes timings unpredictable.
6. You need to wait until a loading spinner has disappeared. Which call expresses that?
reverse: true waits for the condition to become false. waitForExist waits for the opposite, and an implicit wait only affects lookups.
7. In a screen object, why define elements as getters (get inputA() { return $('~inputA') }) instead of storing $('~inputA') in the constructor?
Screen objects are imported before a session starts and live across tests. Lazy getters avoid stale or premature element references.
8. Your JUnit reporter writes files named results-0-0.undefined.xml for a native app run. Why?
Build the filename from cid and a capability that is actually set, such as platformName.
9. On a cloud grid, real-device sessions sometimes fail with UND_ERR_HEADERS_TIMEOUT while the device you asked for is busy. Which config change does TestingBot recommend?
A queued device request can take up to about 390 seconds. The client must wait that long, and a retry would queue a second request rather than help. waitforTimeout only affects element waits.
Next, put the page objects into practice at a larger scale in the Page Object Model course, or, if your team is also testing mobile apps with a declarative YAML approach, try the Maestro course. For day-to-day reference, keep the TestingBot Appium options page open.
You finished Appium Tutorial with WebdriverIO
Put what you learned into practice. Run your tests on 6100+ real browsers and physical iOS and Android devices.