Fallback Accessors for Mobile Testing
Recommended guidance
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
- Confirm the primary and fallback accessors identify the same business control.
- Test on the target device types, orientations, and OS versions.
- Prefer accessibility labels, stable resource IDs, and meaningful text over coordinates.
- Document why the fallback exists and when it should be reviewed.
Last updated: October 6, 2026