Mobile Testing
Accessibility identifier
Also known as: accessibilityIdentifier, testTag
An accessibility identifier is a stable, developer-assigned string attached to a UI element so tests can locate it without depending on its visible label, position, or view hierarchy.
UI tests need to name the element they act on. The fragile ways to do that are by visible text, which breaks on copy changes and in localised builds, and by hierarchy position, which breaks whenever the layout is refactored. An accessibility identifier is set explicitly on the element and is not user-visible, so it survives both — which is why it is the recommended query strategy in XCUITest, and why Espresso and Compose offer the equivalent through view IDs and test tags.
Adopting identifiers converts a class of intermittent failures into compile-time-obvious ones. A test that queried a button by its label fails mysteriously the day marketing rewords it; a test that queried a stable identifier keeps passing, and if the identifier is removed the failure is immediate and unambiguous rather than intermittent.
- Not user-visible, so copy changes and localisation do not break the query.
- Survives layout refactors that break hierarchy-based selectors.
- Turns a class of silent flakiness into deterministic, obvious failure.
Learn more
Related terms
See it in your own test results
Qualflare detects flaky tests, clusters failures by root cause, and scores release risk from the test results you already produce in CI. Start free.
Start free with Qualflare← Back to the testing & observability glossary.
Last reviewed September 10, 2026