Appium
Cross-platform UI automation driving native, hybrid, and mobile-web apps over the WebDriver protocol, so one suite can target both iOS and Android. Interviewers ask about locator strategies and flakiness, because that is where mobile end-to-end suites usually die.
on this pageshowhide
guide
overview
~1 minAppium is an open-source automation server that drives native, hybrid and mobile-web apps through the W3C WebDriver protocol, so one test codebase can reach Android and iOS. Interviewers probe it because mobile end-to-end suites are expensive, slow and fragile, and the candidate who can explain *why* a run failed is worth more than one who can only write the happy path. The questions reward knowing where the two platforms agree, where they quietly diverge behind the same keyword, and which layer of the stack owns a given failure. The hub follows the life of a test run. [Stack anatomy](/topics/mob-appium-arch) is the map: the client, the server, the driver and the agent on the device. [Capability sets](/topics/mob-appium-caps) are what a session is opened with. [Element addressing](/topics/mob-appium-locators) is how a test names what it wants, and the section with the most questions. [Input and timing](/topics/mob-appium-interaction) covers gestures, typing and waiting; [app and device control](/topics/mob-appium-appcontrol) covers everything outside the app's own screen, from install and reset to web views and system prompts. [Fleet execution](/topics/mob-appium-fleet) takes one session to many devices, remote servers and pipelines, and [inspection and flakiness](/topics/mob-appium-triage) is where you go when it breaks. Junior rounds ask what a strategy or capability does on each platform. Senior and principal rounds hand you a broken run — a session that never starts, a build that did not reinstall, a tap that lands on nothing — and expect a diagnosis that names the tier at fault before the fix. Learn the stack first, because every later answer names a tier of it. Then capabilities and locators, since a session that opens on the wrong device or finds the wrong element makes everything after it noise.
primer
### One protocol, two engines Appium's promise is a single wire protocol, not a single implementation. Every command crosses the same W3C WebDriver routes, but the work is done by a platform driver — UiAutomator2 or Espresso on Android, XCUITest on Apple platforms — and each driver inherits its platform's model of the screen. That is why so many questions take the form "what does X do on Android, and what on iOS": the keyword is shared, the semantics often are not. A strong answer states the shared contract, then the divergence. ### The server is a router; drivers do the work Since Appium 2 the server ships without any driver, and drivers, plugins and their versions are installed and upgraded separately. The server parses the session request, picks a driver from the capabilities, and forwards commands. Platform-specific features that the W3C route table has no room for travel through one generic execute endpoint as named `mobile:` methods. Knowing which piece owns a feature tells you which piece to upgrade, configure or blame. ### A session is decided before the first command Capabilities fix the driver, the target device, the app build and session behaviour such as reset policy and idle timeouts. Many surprises — the wrong device, a stale build, a session that dies mid-test — trace back to a capability that was missing, misnamed or read differently by the two drivers. Treat the capability set as configuration you can defend line by line. ### Locators are a portability decision Some strategies are portable in name only; others are query languages that exist on a single platform. The durable choice is an identifier the app team controls and exposes to accessibility tooling on both platforms, because a locator tied to layout, text or tree position breaks with the next redesign or translation. XPath works everywhere and costs the most, which interviewers expect you to explain rather than merely avoid. ### Flakiness has mobile-specific causes A mobile run inherits every browser-testing timing problem and adds its own: animation, the soft keyboard, OS-owned prompts, slow virtual devices and an element tree that changes while you read it. Good suites wait on observable conditions rather than fixed sleeps, and treat each flake as a cause to classify, not a retry to add. ### The device is part of the system under test Real phones need developer settings and, on Apple hardware, a signed on-device agent; virtual devices need host toolchains, and iOS simulators need a Mac. Parallel runs need isolated ports and devices. Fleet questions test whether you see the device estate as infrastructure with its own failure modes.
- Driver
- A separately installed Appium extension that implements automation for one platform, such as UiAutomator2 or Espresso for Android and XCUITest for Apple platforms.
- Capabilities
- The key-value set sent when opening a session. It names the platform, driver, device and app, and configures how the session behaves.
- appium: prefix
- The vendor namespace that every non-W3C capability must carry. Standard keys such as platformName and browserName go without it.
- WebDriverAgent
- The XCTest-based agent that the XCUITest driver builds, signs and launches on the iOS device or simulator, and which carries out each command.
- UiAutomator2 server
- The helper app the UiAutomator2 driver installs on the Android device to run commands through Google's UiAutomator framework.
- Locator strategy
- The named method a find call uses to match elements, such as accessibility id, class name, xpath or a platform-only query language.
- Accessibility id
- A locator strategy mapped to an accessibility-facing field on each platform, which makes it the usual first choice for cross-platform tests.
- mobile: methods
- Driver-specific commands invoked through the standard execute endpoint by name, covering features the W3C route table does not define.
- Context
- The surface a session's commands target: the native app, or one of its web views, each addressed by a handle you switch to.
- W3C Actions
- The standard input API that describes gestures as timed sequences of pointer and key events; it replaced the older touch endpoints.
- newCommandTimeout
- A capability setting how long the server waits without receiving a command before it ends the session on its own.
- Appium Inspector
- A graphical client that attaches to a server, shows a screenshot beside the element tree, and suggests locators for a selected element.
- Reset policy
- The capabilities, mainly noReset and fullReset, that decide whether app data is cleared or the app reinstalled between sessions.
### Four tiers, one command A test calls something like a find or a tap in a language client. The client turns it into an HTTP request against the Appium server. The server matches the session to its driver, and the driver either answers locally or forwards the work to an agent on the device — the UiAutomator2 server on Android, WebDriverAgent on iOS — which uses the platform's own automation framework against the running app. Responses travel back the same way. Every triage question in this hub is a question about which hop broke, and both platforms fail at startup in recognisably different ways because their agents are started so differently. ### Where the other sections attach - **Capabilities** are read once, at session creation, by the server and the driver; changing most of them means a new session. - **Locators** are mostly evaluated by the device-side agent, which is why their cost and their meaning depend on the platform. - **Interaction** commands become actions the agent performs; explicit waits are client-side loops that keep asking the server until a condition holds. - **App control** spans tiers: install and reset happen on the host through platform tools, web views add a second automation bridge, and system prompts live outside the app entirely. - **Fleet execution** multiplies the whole chain — many servers or one server with many sessions, each pinned to its own device and ports. A session request shows where the tiers meet: standard keys pick the platform, prefixed keys pick the driver and device, and session behaviour is fixed before the first command. ```json { "capabilities": { "alwaysMatch": { "platformName": "Android", "appium:automationName": "UiAutomator2", "appium:udid": "emulator-5554", "appium:app": "/builds/app-release.apk", "appium:newCommandTimeout": 120 } } } ``` Nothing here is portable by accident. The iOS equivalent changes the driver, the device keys and the build format, and the `appium:app` path is read wherever the server runs, not where the test runs.
- Stack Anatomy →
The map every answer refers to: client, server, driver and on-device agent, and which one owns a failure.
- Capability Sets →
How a session is opened: which keys pick the driver, device and build, and which control reset and timeouts.
- Cross-Platform Strategies →
Start with the strategies both platforms accept, and learn where the same keyword matches different fields.
- Waiting on Screen →
Waiting on observable state is the base of every stable gesture, typing step and assertion.
- App and Device Control →
Install, reset, web views and system prompts: the steps outside the app where the platforms diverge most.
- Inspection and Flakiness →
Close the loop: reading the Inspector and logs, and classifying the failures a real device produces.
Assuming a shared locator keyword means the same thing on both platforms:
idandaccessibility idresolve to different app-side fields on Android and iOS.Reaching for XPath by default because it works everywhere, without being able to say why each find is slow on both platforms.
Fixing flaky steps with fixed sleeps or blanket retries instead of waiting on a visible condition and naming the mobile-specific cause.
Expecting a vendor capability with no
appium:prefix to be ignored: the server rejects the session, while a prefixed but unknown key passes silently.Trusting
noResetfalse to give a clean start on every target; what the default reset does differs between Android, iOS simulators and real iPhones.Upgrading the language client to reach a new
mobile:command when the version that matters is the driver installed on the server.Treating Appium Inspector's tree as live: it is a snapshot from the last refresh, so it can disagree with what the test finds.
Diagnosing a session that fails to start from the test's stack trace alone, instead of reading the server log to the last step that succeeded.
This guide assumes Appium 3. Several questions still turn on what changed across major versions, because many suites, client libraries and tutorials predate it: - **Appium 2** split the project apart: the server no longer bundles drivers, so UiAutomator2, XCUITest, Espresso and the rest are installed and versioned as separate extensions, alongside plugins. It also required the `appium:` prefix on vendor capabilities. - **Appium 3** finished removing legacy surface. Session requests must use the W3C `capabilities` body with `alwaysMatch` and `firstMatch`; the old touch endpoints are no longer routed, so gestures go through W3C Actions; and many older `/appium/` routes were deleted, with driver `mobile:` methods as the usual replacement. Some client libraries still ship deprecated helpers for the removed routes, which compile but fail against the new server. When an answer depends on version — how a session request is shaped, which gesture API exists, whether drivers come with the server — say which major version you mean. Teams running older stacks will ask, and naming the era is part of the answer.
Interviewers expect you to place Appium among the alternatives, not only use it. Its distinguishing trade is reach: it drives a built app from outside, through the platform's own automation frameworks, so one suite in any WebDriver-supporting language can cover Android, iOS and mobile browsers, and can follow a journey into system settings or another app. The price is speed and stability compared with tools that run inside the app. The platform-native frameworks — Espresso on Android and XCUITest on Apple platforms — run closer to the app, synchronise with it more tightly and are usually faster, but each covers one platform and is normally written by the app team in the app's own language. Appium wraps both of them as drivers, which is why their behaviour leaks into its answers. Detox and Maestro are newer mobile end-to-end tools that trade some of Appium's breadth for simpler setup or built-in synchronisation. Selenium is the browser-side relative that shares the protocol. Cloud device farms host the devices and servers rather than replacing the tool, so the [fleet execution](/topics/mob-appium-fleet) questions apply there too.
explore
- Stack Anatomy38 questions
- Protocol Lineage12 questions
- Platform Engines18 questions
- Separate Artifacts8 questions
- Capability Sets25 questions
- Naming and Matching9 questions
- Application Under Test8 questions
- Runtime Controls8 questions
- Element Addressing47 questions
- Cross-Platform Strategies15 questions
- Android Selector Dialects10 questions
- iOS Query Languages8 questions
- Locator Longevity14 questions
- Input and Timing29 questions
- Waiting on Screen7 questions
- Touch and Motion13 questions
- Keyboard and Buttons9 questions
- App and Device Control41 questions
- Lifecycle Transitions18 questions
- Hybrid and Web14 questions
- Platform Prompts9 questions
- Fleet Execution34 questions
- Device Targets14 questions
- Simultaneous Sessions5 questions
- Environment Controls7 questions
- Build-Time Runs8 questions
- Inspection and Flakiness16 questions
- Live Introspection8 questions
- Recurring Failures8 questions
questions
230 · 7 sectionsIn Appium 3, what must a POST /session request body contain to start a session?
basics
~10 sAppium 3 accepts a single top-level capabilities object holding alwaysMatch and firstMatch. The older desiredCapabilities and requiredCapabilities bodies are no longer accepted, and every Appium-specific key inside carries the appium: prefix.
In Appium, what is WebDriverAgent and why does an XCUITest session need it?
basics
~20 sWebDriverAgent is the on-device XCTest runner that Appium's XCUITest driver builds, signs, installs and launches. It holds Apple's automation APIs, so the driver never touches the app itself — it forwards every command to that agent over HTTP.
In Appium, what does a session add on top of the W3C WebDriver protocol?
basics
~20 sAppium speaks W3C WebDriver unchanged and adds four things: the appium: capability prefix, per-driver mobile: and flutter: execute methods, its own web-view context routes, and, in Appium 3, the deletion of many old /appium/ routes.
Why does a freshly installed Appium server automate nothing until you install a driver?
basics
~20 sAppium 2 turned drivers into separately installed extensions, so the server package ships only the protocol layer and the extension machinery. Until you install a driver - UiAutomator2 for Android, XCUITest for Apple platforms - no session can start.
In Appium, what does the official Flutter driver attach to in order to drive a Flutter app?
basics
~10 sAppium's official appium-flutter-driver attaches over a WebSocket to the Dart VM Service that a running Flutter build publishes, and drives widgets through the ext.flutter.driver service extension registered by Flutter's test package.
In Appium, what does appium:deviceName select on Android compared with iOS?
basics
~10 sOn iOS, appium:deviceName together with appium:platformVersion picks a simulator by model and runtime. On Android the drivers accept the key but never select with it; appium:udid or appium:avd chooses the target there.
In Appium, which capabilities choose the driver and which choose the device under test?
basics
~10 sTwo capabilities choose the driver: platformName and appium:automationName. Different keys choose the machine, and they differ by platform: appium:udid or appium:avd on Android, appium:deviceName with appium:platformVersion for an Apple simulator.
In Appium on iOS, which capabilities sign WebDriverAgent for a real device?
basics
~20 sThree XCUITest capabilities: appium:xcodeOrgId names the Apple Developer team, appium:xcodeSigningId names the signing identity, and appium:updatedWDABundleId rebuilds the agent under a bundle identifier your provisioning profile covers. Android has no equivalent, because it has no provisioning profile.
In Appium, what does the app capability accept, and which identity key does each platform read from it?
basics
~20 sThe app capability takes a local path or http URL to one build artifact: an APK for Android, an IPA or .app bundle for iOS. Each driver reads the app identity from it - the Android package name, the iOS bundle id.
In Appium, what happens when a session request sends a vendor capability with no appium: prefix?
basics
~20 sThe Appium server refuses the session and answers with an invalid argument error naming the key. A non-standard capability with no colon namespace is illegal under the W3C protocol, so it is rejected rather than quietly ignored.
In Appium, which app-side field does an `accessibility id` locator match on Android, and which on iOS?
basics
~20 sOn Android the accessibility id strategy matches an element's content-desc. On iOS the XCUITest driver resolves it through the name attribute, which is the element's accessibilityIdentifier or, when that is empty, its visible localised label.
In an Appium `-ios class chain`, what do the `/` and `**/` steps mean?
basics
~10 sIn Appium's iOS class chain strategy, a single slash requires the next element type to be a direct child of the previous match, while a double-star slash lets it sit at any depth below.
In Appium, what does the `id` locator strategy match on Android, and what on iOS?
basics
~20 sOn Android the id strategy matches an element's resource-id, the package-qualified identifier fixed in the build. On iOS it is an alias for the name attribute, which XCUITest fills from the accessibility identifier. Same keyword, two unrelated attributes.
In a React Native app under Appium, what does the `testID` prop set on iOS and on Android?
basics
~20 sA React Native testID sets the iOS accessibilityIdentifier, which the XCUITest driver exposes behind the name attribute, and on Android it surfaces as the view's resource-id in the page source. Android's content-desc is filled by accessibilityLabel instead.
In Appium, what does the `-android uiautomator` locator strategy send to the device, and who evaluates it?
basics
~20 sIt sends a UiSelector expression as a plain string of chained Java-style calls. Appium's Android UiAutomator2 driver passes it to its on-device server, which parses the text and lets Google's UiAutomator framework match the live view hierarchy.
In Appium, what does a POST /session/:sessionId/actions body contain to tap one point?
basics
~20 sOne pointer input source, and inside it the ticks that model the finger. The source declares an id and a pointer type of touch; the ticks are a move to the coordinate, a press and a lift.
In Appium, which command scrolls an off-screen row into view on Android, and which on iOS?
basics
~10 sOn Android the UiAutomator2 driver scrolls while it searches: an -android uiautomator selector running UiScrollable scrollIntoView, or mobile: scroll. On iOS, XCUITest scrolls to an element you have already found, with mobile: scrollToElement.
In Appium 3, what replaced the touch/perform endpoints, and is TouchAction gone?
basics
~20 sThe W3C Actions API replaced them: gestures now go to the actions endpoint. TouchAction is not gone from the clients — java-client still ships it marked deprecated — but the Appium 3 server no longer routes the old touch paths.
In Appium, which request types text into a native field on Android and on iOS?
basics
~20 sBoth platforms answer POST /session/:sessionId/element/:elementId/value with a text field. On Android the UiAutomator2 agent performs the typing; on iOS WebDriverAgent does, at a rate the maxTypingFrequency setting bounds. Each driver adds its own typing methods.
In Appium, why does a pointerDown then pointerUp action chain tap instead of long-pressing?
basics
~20 sNothing in the chain holds the finger down. A pointer sequence advances one tick at a time, so a press is followed immediately by the lift. Insert a pause tick carrying the dwell between them.
In Appium, which command accepts a system alert on Android, and which one on iOS?
basics
~10 sOn Android the UiAutomator2 driver exposes mobile: acceptAlert and mobile: dismissAlert; on iOS the XCUITest driver exposes mobile: alert, and only iOS also has the appium:autoAcceptAlerts capability that handles alerts without a call.
In Appium, which browser does a `browserName` session drive on Android, and which on iOS?
basics
~20 sSending browserName instead of an application makes the phone's own browser the app under test: Chrome on Android, whose page commands a Chromedriver answers, and Safari on iOS, driven by XCUITest through Apple's remote web inspector.
In Appium, how is a web-view context handle named on Android compared with iOS?
basics
~20 sBoth platforms share the WEBVIEW_ prefix and then diverge: Android appends the package name of the process hosting the web view, while iOS appends a numeric page id that the remote debugger assigns at runtime.
In Appium, which commands foreground, background and terminate the app under test on Android and Apple platforms?
basics
~20 sBoth sides share mobile: activateApp to foreground an app, mobile: backgroundApp to suspend it, mobile: terminateApp to stop it and mobile: queryAppState to check it. Android adds mobile: startActivity; Apple platforms add mobile: launchApp and mobile: killApp.
In Appium on Android, what does the appium:autoGrantPermissions capability do?
basics
~20 sIt tells the Android drivers to grant every permission the app declares as part of installing it, so no runtime prompt ever appears. It is an install-time switch decided at session start, and the XCUITest driver has no equivalent.
In Appium, which request captures a still screenshot on Android and on iOS?
basics
~10 sBoth platforms answer the same W3C request, GET /session/:sessionId/screenshot, and return the whole screen as a base64-encoded PNG. Appium's UiAutomator2 driver on Android and its XCUITest driver on Apple platforms behave identically here.
In Appium, what must be enabled on a real Android phone and on a real iPhone before a session starts?
basics
~20 sAndroid needs developer options with USB debugging on and the host authorised, so the phone lists as online. Apple hardware needs Developer Mode enabled, the host trusted, and a signed WebDriverAgent the operating system will launch.
In Appium, what changes when the server URL is remote instead of localhost?
basics
~20 sOnly the endpoint changes: scheme, host, port and any base path. The Android and iOS capability sets travel unchanged — capabilities describe a device and a build, never a server. The catch: path-valued capabilities resolve on the server's filesystem.
In Appium, how does a session get onto an Android emulator versus an Apple simulator?
basics
~20 sTwo different toolchains. On Android the drivers launch or attach to a named AVD and reach it over adb like any other Android target. On Apple the XCUITest driver boots a simulator with simctl, which requires a macOS host with Xcode.
In Appium, when does an appium:language or appium:locale change take effect on Android and iOS?
basics
~20 sBoth are session-start capabilities, so on Android and on Apple real devices a language or locale change needs a new session. Apple simulators are the exception: XCUITest's mobile: configureLocalization changes localization inside a live session.
In Appium, which flake sources does a mobile run have that a browser run cannot?
basics
~20 sMobile adds five failure sources a browser page cannot have: system animation moving the target, the soft keyboard drawn over it, an OS-owned prompt above the app, a slow emulator or simulator, and an element tree that is already stale.
In Appium, how do you take system animation out of a greenhouse climate run on Android and iOS?
basics
~20 sTurn the motion off at the device. On Android the appium:disableWindowAnimation capability drops the system animation scales for the session; on Apple platforms the XCUITest driver's reduceMotion setting asks the OS to prefer non-motion transitions.
Appium Inspector's attach-to-session list is empty though a locksmith call-out session is running — why?
basics
~10 sThe Inspector builds that list from GET /appium/sessions, which Appium gates behind the session_discovery insecure feature. Start the server with allow-insecure set to the scoped name *:session_discovery, or the list stays empty.
Why can Appium Inspector show a locksmith call-out element that your test's find call cannot match?
basics
~20 sThe Inspector's tree is a page-source snapshot from your last refresh, not a live view, and it is depth-capped by snapshotMaxDepth. Your test's find runs against its own fresh capture, so the two can honestly disagree.
In Appium, which request pulls a device log, and which log types exist on Android versus iOS?
basics
~20 sAppium pulls device logs with POST /session/:sessionId/se/log, naming a type in the body. The Android drivers offer logcat and bugreport; the XCUITest driver offers syslog, crashlog and safariConsole. GET /session/:sessionId/se/log/types lists what a driver serves.