What Appium is, and how it works
Automating a mobile app is harder than a web app, and it helps to understand why before you write a test. A phone app is not a web page — there is no browser, no DOM you can inspect the usual way, and the app runs on a device or emulator you must talk to over a chain of tools. Appium is the standard tool for automating native mobile apps, and this lesson explains what it is and how the pieces fit, so the tests in the rest of the module make sense rather than feeling like magic.
A note on this module, honestly
The web-automation module drove the real AgentPay dashboard and you ran every test. Mobile automation needs a device or emulator (an Android emulator or a physical phone, an iOS simulator on a Mac), plus Appium and its drivers installed — a heavier setup than a browser, and one this course cannot run for you inside a lesson. So treat this module as a faithful guide with correct, runnable code you set up on your own machine, rather than something you can execute in the browser as you read. The concepts, the code and the judgements are real; the reason the reference repo's automation is API + web is exactly this cost — which is itself one of the honest lessons about mobile automation (the reality lesson). Where the examples need an app, picture the AgentPay agent app: the mobile app a field agent would use to record a transaction — the same domain as the API and dashboard you already know.
What Appium is
Appium is an open-source tool that automates native, hybrid and mobile-web apps on Android and iOS. Its defining idea: you write your test in the same WebDriver protocol used for browser automation (Selenium), so one API and one style of test can drive a phone app. You send commands like "find this element", "tap it", "type here" — and Appium translates them into the platform's own automation instructions.
The big win is one API for both platforms: the same test code (with different configuration) can run against Android and iOS, because Appium hides each platform's native automation framework behind the common WebDriver interface. That is the mobile echo of Playwright's "one API, three browsers".
The pieces, and how a command travels
A mobile test involves a chain, and knowing it makes failures diagnosable:
- Your test (in JavaScript/Python/Java — this course shows JavaScript with WebdriverIO, a common Appium client) sends a WebDriver command.
- The Appium server receives it. Appium is a server you run; your test is a client that talks to it over HTTP.
- A driver — Appium delegates to a platform driver: UiAutomator2 for Android, XCUITest for iOS. The driver knows how to automate that platform.
- The platform's automation framework (Google's UiAutomator, Apple's XCUITest) actually performs the action on the device.
- The device or emulator — a real phone/tablet, an Android emulator, or an iOS simulator — runs your app and receives the tap or text.
So a single "tap the button" travels: test → Appium server → driver → platform framework → device. Each hop is a place setup can go wrong (a missing driver, an unreachable device), which is why mobile setup is fussier than web — and why reading the error to find which hop failed is a core skill.
Capabilities: describing what to automate
Because there is no single "the app" (there is an app on a specific device), a mobile test starts by declaring capabilities — a configuration object telling Appium what to drive:
const capabilities = {
platformName: 'Android',
'appium:automationName': 'UiAutomator2',
'appium:deviceName': 'Pixel_7_API_34', // the emulator or device
'appium:app': '/path/to/agentpay-agent.apk', // the app under test
};
For iOS you would set platformName: 'iOS', automationName: 'XCUITest', a simulator name, and a .app
path. Capabilities are how the same test targets different devices and platforms — change the capabilities,
not the test. Getting them right (the correct driver, a booted device, a valid app path) is most of what
makes a first mobile test finally connect.
Prerequisites, briefly
To run mobile tests you install: Node.js, Appium (npm install -g appium), the drivers (appium driver install uiautomator2 and/or xcuitest), and the platform SDKs — the Android SDK and an emulator
for Android, Xcode and a simulator for iOS (Mac only). appium-doctor checks your setup is complete.
This is genuinely more involved than npm init playwright — budget time for it, and expect the first
connection to take some fiddling. That friction is real and worth knowing before you start.
Check your work
This module needs a device/emulator + Appium + drivers, which a lesson cannot run for you — so it is a faithful guide with real code you set up yourself; picture the AgentPay agent app. The heavy setup is itself an honest lesson about mobile automation's cost.
Appium automates native/hybrid/mobile-web apps on Android and iOS using the WebDriver protocol — the same API style as browser automation — so one test style drives a phone, and (with different config) one API targets both platforms.
The chain: your test (client) → Appium server (HTTP) → a driver (UiAutomator2 Android / XCUITest iOS) → the platform's automation framework → the device/emulator. Every hop is a place setup can fail — read the error to find which hop.
Capabilities configure what to drive (platformName, automationName, deviceName, app path) — change the
capabilities, not the test, to target a different device/platform. Prerequisites: Node, Appium, drivers,
Android SDK/Xcode; check with appium-doctor. Setup is fussier than web — expect friction.
Practice
- Draw the chain a "tap" command travels from your test to the device, and name what could fail at each hop.
- Explain, in your own words, why Appium uses the WebDriver protocol and what "one API for both platforms" buys you.
- Write a capabilities object for an Android emulator running the AgentPay agent app; then adapt it for iOS.
- List the tools you must install to run Appium tests on Android, and what
appium-doctorchecks. - Explain why mobile setup is more error-prone than web setup, referring to the command chain.
- Given an error "could not find UiAutomator2 driver", say which hop failed and how you would fix it.
Official documentation
- Appium — Introduction — What Appium is and its architecture.
- Appium — Drivers — UiAutomator2 (Android) and XCUITest (iOS).
- WebdriverIO — Appium setup — The client this course uses, and its capabilities.
Next: your first mobile test.
Stuck on this lesson?
Being stuck is part of it — but being stuck alone for three days is not. Our internship programme pairs this curriculum with code review and one-to-one help from working developers, and it is free.
About the internship