Appium is often described in one line: Selenium for mobile apps. That description is roughly right about the interface and quite misleading about what happens underneath. A single tap in an Appium test passes through several layers of software, across a network connection and into the operating system’s own automation framework before anything touches the screen. Knowing that chain explains most of what people like and dislike about Appium, and when a different tool is the better choice.

The journey of one tap

Follow a test that taps a “Pay now” button in a shopping app.

  1. The test script, written in Java, Python, JavaScript or another language, calls a client library. The client turns “find element by accessibility ID pay_now, then click” into HTTP requests that follow the W3C WebDriver protocol, the same standard browsers use.
  2. The Appium server, a Node.js process, receives those requests. It does not itself know how to automate a phone. It routes each command to whichever driver the session is using.
  3. The driver translates the command for its platform. For Android the common choice is the UiAutomator2 driver; for iOS it is the XCUITest driver.
  4. An on-device agent does the actual work. UiAutomator2 installs a small server app on the Android device that uses Google’s UiAutomator framework. The XCUITest driver uses WebDriverAgent, a server running on the iOS device or simulator, built on Apple’s XCTest framework.
  5. The operating system’s automation framework finds the button in the accessibility hierarchy and performs the tap. The result travels back up the same chain.

Each command is a round trip through all of these layers. That is why Appium tests are noticeably slower than native tests, and why a cloud device farm in another region adds visible latency to every step.

Why this design is useful

The layered design has real advantages:

  • Any language. Because the interface is a standard HTTP protocol, a team can write mobile tests in the same language as its web tests and share utilities, reporting and CI setup.
  • No changes to the app. Appium automates the release-style build through the operating system’s accessibility layer. You test the app much as a user receives it, without adding test libraries into the app.
  • One framework for two platforms. A single test suite structure can cover Android and iOS, with platform differences hidden behind page objects.
  • Beyond your own app. Because it works at the system level, Appium can interact with system dialogs, settings and other apps, which helps for flows such as granting permissions or opening a link from an SMS.

Since Appium 2, drivers are installed separately from the server, rather than bundled. This lets each driver evolve on its own schedule and lets teams add drivers for other targets, such as Flutter or Windows apps, as needed. Session settings are passed as capabilities, with Appium-specific ones carrying an appium: prefix under the W3C rules.

Where the design costs you

Appium is a black-box tool. It sees the app from outside, through the accessibility tree, and has no idea whether the app is busy. If tapping “Pay now” triggers a network call and an animation, Appium does not know when the app has settled. The test must wait explicitly for the next expected element. Poorly designed waits are the most common source of flaky Appium tests.

Locators are the other common pain. XPath queries over a deep mobile view hierarchy are slow and brittle, especially on iOS. Stable accessibility identifiers, added by developers for that purpose, make tests faster and more reliable on both platforms. Agreeing on these early with the app team is one of the most valuable things a mobile tester can do.

Finally, the many moving parts mean many version dependencies: client library, server, driver, Xcode or Android SDK tooling, the device OS. An iOS update can require a new WebDriverAgent build before tests run again. Pinning versions and upgrading deliberately saves many lost afternoons.

The native alternatives: Espresso and XCUITest

Google’s Espresso (Android) and Apple’s XCUITest (iOS) are the platform owners’ own UI testing frameworks. Tests are written in the app’s languages (Kotlin or Java for Espresso, Swift for XCUITest) and live in the same repository as the app.

Espresso in particular runs in the same process as the app and synchronises with the app’s main thread: it waits automatically until the UI is idle before acting, and can be told about background work through idling resources. That removes a whole class of timing problems. XCUITest runs in a separate process but is still tightly integrated with Apple’s tooling. Both are significantly faster than Appium and very well suited to developers writing UI tests alongside features.

AspectAppiumEspresso / XCUITest
Test languageAny with a client libraryKotlin/Java or Swift
Platforms per suiteAndroid and iOSOne each
SpeedSlower, network round tripsFaster
SynchronisationExplicit waits neededBuilt-in (especially Espresso)
Access to app internalsNoneSome, useful for setup
Typical ownersQA automation teamApp developers

Choosing between them

The choice is mostly about people and purpose. If a separate QA team owns end-to-end tests across web, Android and iOS, and writes them in one language, Appium fits. If developers own UI tests and want fast feedback on each pull request, native frameworks fit better. Many mature mobile teams use both: Espresso and XCUITest for broad, fast component-level UI coverage written by developers, and a smaller Appium suite for cross-platform, end-to-end journeys such as sign-up, payment and order tracking that need to run on a device farm before release.

What does not work is expecting Appium to do the volume of testing that belongs at lower levels. A thousand slow, black-box UI tests on real devices will be expensive to run and painful to keep green, whichever tool sits underneath.

Written by the RP Strativa Team. The shopping app in the example is illustrative.

Leave a Reply

Trending