Stop 09 · Mobile TestingTopics · 3/8

Appium Fundamentals

Part of the QA Testing Roadmap

In short

If you know Selenium, you're halfway to Appium. It uses the same WebDriver idea to drive Android and iOS apps, so one skill set covers both platforms.

A cross-platform mobile automation framework — using a similar API structure to Selenium's WebDriver, letting testers automate both iOS and Android apps with shared knowledge and, partially, shared code.

The purple blob sits on a sofa pointing a single remote control.

Think of it like this

The universal remote

One remote works your TV and your AC. The buttons look the same, but inside it sends a different signal to each machine. Appium is that remote: one API for your tests, a different driver underneath for Android and iOS.

Watch it happen

One tap, through Appium

Test script
Appium server
UiAutomator2
Device

new session + caps

1/6The script sends capabilities: platform, device and app path.

The big ideas

What you need to know

Server plus drivers

Appium 2 is a server you install with npm. Drivers like uiautomator2 and xcuitest are installed separately.

Capabilities

Capabilities tell Appium what to run: platformName, deviceName, app path, automationName.

Accessibility ids

The most stable mobile locator. Ask developers to add them, which also helps screen reader users.

Appium Inspector

A desktop tool to view the app's element tree and try locators, like DevTools for apps.

See it in code

Walk through the code

python
1from appium import webdriver2from appium.options.android import UiAutomator2Options3from appium.webdriver.common.appiumby import AppiumBy4 5options = UiAutomator2Options()6options.platform_name = "Android"7options.device_name = "emulator-5554"8options.app = "/full/path/to/app-debug.apk"9 10driver = webdriver.Remote("http://127.0.0.1:4723", options=options)11driver.find_element(AppiumBy.ACCESSIBILITY_ID, "Login").click()12driver.quit()

1/3Capabilities say which platform, which device and which app to install.

Setup: npm i -g appium, appium driver install uiautomator2, run appium, then pip install Appium-Python-Client.

Save yourself the pain

Common mistakes

Oops

Locating elements by long XPath copied from the inspector.

Do this instead

Prefer accessibility ids or resource ids. Mobile XPath is slow and fragile.

Oops

Following an old tutorial that uses /wd/hub and desired_capabilities.

Do this instead

Appium 2 uses options objects and the server root URL by default.

Your mission

Your first Appium session

~45 min

Quick check

In Appium, what decides whether commands go to Android or iOS?

Go deeper

  1. 1Set up Appium and write a basic automation script for a sample mobile app.
  2. 2Learn how Appium's architecture connects to iOS and Android's native automation frameworks underneath.
  3. 3Compare Appium's API structure to Selenium's WebDriver from Phase 7.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge