QA Interview Hub · Knowledge base · Quizzes · Українська
14 Appium questions that come up in QA interviews, with short answers. Open the topic in the knowledge base for a deeper explanation.
A client–server architecture on the W3C WebDriver protocol. A test with a client library (java-client) sends HTTP/JSON requests to the Appium server (Node.js, port 4723), the server passes them to the platform driver, which controls the device through a helper agent (UiAutomator2 server on Android, WebDriverAgent on iOS). The app does not need to change: it is a black box.
Android: UiAutomator2 (appium:automationName = UiAutomator2), for Android 8.0+ (since driver 6.0); there is also Espresso. iOS: XCUITest (automationName = XCUITest) built on WebDriverAgent; it needs macOS and Xcode. The driver is chosen by the pair platformName + appium:automationName.
The server ships without drivers: they are installed separately — appium driver install uiautomator2 or xcuitest (list: appium driver list --installed). The same goes for plugins: appium plugin install, enabled with --use-plugins. The server base path is no longer /wd/hub but /, so the URL is http://127.0.0.1:4723.
At minimum: platformName, appium:automationName (the driver), appium:app (the build) or a browser, appium:deviceName / appium:udid (the device). Under W3C only standard fields (platformName, browserName) go unprefixed, the rest carry the appium: vendor prefix. In Java it is added by UiAutomator2Options and XCUITestOptions. The session is ended by driver.quit(), otherwise it lives until newCommandTimeout (60 s).
AppiumBy.accessibilityId (content-desc on Android, accessibilityIdentifier on iOS) is the best: stable, fast, shared across platforms. Then id (resource-id on Android), native androidUIAutomator (UiSelector), iOSNsPredicateString and iOSClassChain, and XPath last. MobileBy was removed in java-client 9.0, use AppiumBy.
The driver dumps the whole screen hierarchy as XML and evaluates the expression over it: that is slow (especially in XCUITest). The locator depends on nesting and element order, so it breaks when the layout changes, and it differs between Android and iOS. Prefer accessibility id, id, UiSelector, predicate or class chain.
A separate app (desktop or web) that connects to the Appium server: it starts a session with the given capabilities, shows a screenshot with the element tree and its attributes (accessibility id, resource-id, text), and lets you check a locator before writing code. It does not manage emulators and does not run tests.
An explicit wait (WebDriverWait + ExpectedConditions, for example visibilityOfElementLocated) waits for a concrete condition and ends as soon as it holds, or fails on timeout with a clear reason. Thread.sleep wastes time or does not cover the slow case. An implicit wait applies to every lookup, and mixing it with an explicit one gives unpredictable total time.
Native — written for the platform, elements are exposed to the driver directly; you set appium:app. Hybrid — a native shell with a WebView, so context switching is needed. Mobile web — a site in the device browser: instead of appium:app you set browserName (Chrome, Safari) and open the URL.
A session starts in NATIVE_APP (mobile locators). WebView content is available in the WEBVIEW_<package> context: driver.getContextHandles() lists them, driver.context("WEBVIEW_…") switches, and driver.context("NATIVE_APP") goes back. Web locators (CSS, XPath) work in a WebView. On Android, WebView debugging must be enabled and chromedriver must be compatible.
TouchAction and MultiTouchAction were deprecated in java-client 8 and removed in 11. Use W3C Actions: PointerInput (touch) + Sequence + driver.perform(List.of(sequence)), or ready driver commands through driver.executeScript: mobile: swipeGesture, scrollGesture, clickGesture, longClickGesture (UiAutomator2) and mobile: swipe (XCUITest).
Android emulators and iOS simulators are cheap and fast, suited to CI and daily runs (iOS simulators only on macOS with Xcode). Real devices are needed for camera, biometrics, push, performance and vendor quirks. Cloud farms (BrowserStack, Sauce Labs) give many models and OS versions without your own fleet: the server URL and vendor options change.
One Appium 2 server runs several sessions if they do not share resources: a unique appium:udid per device, appium:systemPort on Android (UiAutomator2, by default the first free port in 8200–8299) and appium:wdaLocalPort on iOS (8100 by default); chromedriverPort too for WebViews. The tests themselves must be independent, with no shared accounts or data.
Thread.sleep instead of explicit waits, animations, system dialogs and push, brittle XPath, shared ports and devices, leftover state from a previous test (noReset / fullReset), a slow emulator in CI. Fix them with explicit waits, disabled animations, stable locators (accessibility id), test isolation and clean state, not "rerun until green".