Locator Strategy, Flakiness & Cross-Platform Tradeoffs
Choosing Robust Locators
Resource IDs and accessibility IDs tend to be more stable across UI changes than a deep, positional XPath, and are usually faster to look up too. Accessibility IDs carry a bonus: they're set to support real screen readers, so relying on them for tests also implicitly checks the app has some accessibility support.
Explicit Waits Over Fixed Sleeps
Wait for a specific condition (element visible/clickable) up to a timeout, rather than a fixed sleep() — proceeds as soon as the condition is met (faster on average) while still tolerating genuine slowness (more reliable) than a sleep that's either too short (still flaky) or too long (wastes time every run). The same principle applies across Selenium and Espresso, not just Appium.
Test Framework Layering
Appium is a language-agnostic automation server; actual test scripts use a client binding (Java, Python, JS) combined with a separate test framework (TestNG, JUnit, Mocha) for organizing/running tests — Appium's server itself has no test-organization features of its own.
Real Devices vs. Emulators/Simulators
Real devices give the most accurate user experience (real performance, sensors, OS behavior); emulators/simulators are faster to provision/reset and easier to scale in CI. Many teams run broad coverage on emulators and reserve real-device testing for specific scenarios or final validation — cloud device farms (BrowserStack, Sauce Labs) exist to make real-device testing at scale practical.
Cross-Platform vs. Platform-Native Tools
Appium's cross-platform reach (one approach for Android + iOS, and via extensions desktop) trades against platform-native tools (Espresso, XCUITest) which are often faster and more deeply integrated with their specific platform. Choose based on whether unified cross-platform coverage or platform-specific depth matters more for the team.
Keep your own version of these notes — editable, searchable, and organised by your stack.
Start free