Self-Healing Tests
// Definition
Test automation that captures multiple element attributes during recording (id, class, position, text, accessibility role) and uses an AI matcher to find the closest replacement when the original locator stops working. Reduces locator-rot maintenance for minor UI changes but cannot recover from major redesigns and can silently mis-bind to wrong elements — healed selectors require human review. Common implementations include Mabl, Testim, Functionize, and the open-source Healenium.
// Why it matters
Self-healing tests auto-adjust locators when the UI changes — tooling guesses a new selector when the old one breaks. QA needs a clear-eyed view: it reduces maintenance noise but can mask real regressions (a button that moved vs a button that broke look the same to the healer). Treat healed locators as a signal to review, not a silent pass.
// How to test
// Validate the *healing report*, not just the green run: // 1. Run suite against a deliberately changed build (e.g. renamed data-cy) // 2. Assert the tool healed AND logged the change for review // 3. Manually confirm each heal was a legitimate move, not a masked break // Anti-test: a removed feature should FAIL, not heal to a lookalike element
// Common mistakes
- Trusting heals blindly so genuine regressions get "healed" past
- No audit trail of what was healed and why
- Letting healing replace good locator hygiene (
data-cy) rather than supplement it
// Related terms
AI Testing
The use of AI — language models, machine-learning classifiers, and AI-powered platforms — to accelerate testing tasks: generating test code from descriptions, analysing logs and stack traces, suggesting edge cases, healing broken locators, comparing screenshots intelligently, and triaging failures. AI augments QA engineers; it does not replace the judgement, exploration, and risk-modelling work that humans still do best.
Flaky Test
A test that passes and fails intermittently without any code changes, often caused by timing issues, shared state, async race conditions, or external dependencies. The single largest source of CI noise.
Regression Test
A test that verifies previously fixed bugs haven't returned and existing features still work after new changes. Forms the safety net for refactoring and feature work.
Learn more · AI Tools for QA
Chapter 3 · Lesson 1: Self-Healing Tests — Mabl, Testim, Healenium