Skip to main content

Fallback Accessors for Mobile Testing

Fallback accessors help mobile tests continue to identify controls when the primary locator is unstable. Use them carefully: a fallback should target the same intended element, not merely a similar visible control.

When to use fallbacks

  • Mobile frameworks generate dynamic IDs or slightly different element trees.
  • Android and iOS expose different locator attributes for the same user action.
  • Responsive layouts or device sizes affect element position.
  • Self-healing requires a controlled alternative locator.

Validation checklist

  1. Confirm the primary and fallback accessors identify the same business control.
  2. Test on the target device types, orientations, and OS versions.
  3. Prefer accessibility labels, stable resource IDs, and meaningful text over coordinates.
  4. Document why the fallback exists and when it should be reviewed.

Last updated: October 6, 2026