AI and auto-healing locators in autotests — what actually works in 2026
The most expensive part of a mature autotest suite is locator maintenance. A team spends more time on “the designer renamed a class — 20 tests are red” than on new scenarios. In 2024–2025 a whole class of products was built around that pain under “AI-powered” and “self-healing” labels. In 2026 it’s clear what actually works in production and what’s a pitch deck.
This guide is what’s under the hood of auto-healing locators, which AI tools actually pay off, and where an LLM in tests works best.
1. What an auto-healing locator is
The idea: instead of a single xpath or CSS selector — several candidates or a semantic model of the element. If the primary locator fails, the framework tries alternatives: text content, ARIA role, neighbouring elements, visual cues.
Two technical approaches:
- Rule-based fallback — record N lookup strategies, on a miss try the next. Algorithmically it’s string similarity (Sørensen-Dice, Levenshtein) between the stored DOM snapshot and the current one. Examples: Healenium, partially Selenide.
- AI / ML-based — a model learns from DOM snapshots and sees “the semantically same element” even if the DOM structure changed. Examples: Mabl, testRigor, Functionize.
2. Open-source: Healenium
Healenium — open-source plug-in for Selenium, Playwright, Appium (GitHub). Stores historic DOM snapshots in Postgres, on failure compares similarity, suggests a candidate locator, and records the healed action in the database.
What it does well:
- Heals renamed classes and attributes.
- Has a web UI to approve/reject changes — QA sees what was patched and can revert.
- Free, self-hosted, doesn’t ship DOM to the cloud.
What it doesn’t do:
- Doesn’t understand “semantics” — catches a class rename but not a button moving to a different part of the UI.
- Doesn’t work with canvas / WebGL games and very dynamic DOM (React with generated ids like
css-zk93k1). - Needs a decent number of successful runs before healing is possible — it needs history.
3. Commercial AI-first platforms
- Mabl (mabl.com) — record-replay + AI auto-heal, UX-test focused, US-market. From $20–50k/year base.
- testRigor (testrigor.com) — natural-language tests (“click on Login button”), AI parses scenarios into actions. From ~$900/month.
- Functionize (functionize.com) — computer vision + ML, catches visual changes, enterprise focus.
What’s promised vs what’s delivered:
- Promised: “70–90% reduction in maintenance” → in production usually 30–50%, and only on stable UIs.
- Promised: “NL tests are clear to the business” → they’re written by the same QAs who wrote Selenium. The business won’t read them.
- Promised: “AI will fix it itself” → in practice that’s an “accept change” button, and if QA clicks it without looking, regressions land.
- Promised: cross-browser stability → in practice Safari behaviour often differs from Chrome, and AI doesn’t fix race conditions.
4. LLMs in autotests: ChatGPT, Claude, Cursor
An LLM as a “QA co-pilot” is no longer exotic in 2026 — it’s part of the workflow. Where it works really well:
- Locator generation from screenshots (Vision API) — feed a mockup or a real screen, get candidate selectors. Saves time on new screens.
- Flaky-test debugging — feed it the log + DOM snapshot, get a root-cause hypothesis. Often more precise than a human on the first iteration.
- Auto-generating test cases from a user story or Acceptance Criteria. Not final cases, but a skeleton the QA polishes.
- Autotest code review in CI — the model catches “locator without data-testid”, “no assertion”, “hard-coded sleep”.
- Test data generation — factories, edge-case values, realistic user profiles.
- Root cause from failed runs — the model reads the log, screenshot, and network trace and produces a hypothesis.
Playwright has community plugins like playwright-ai that can run NL instructions inside a test (“find the login button and click it”) via an LLM. Useful for exploratory, but in regression it’s too slow and unpredictable.
5. Real risks
- Hallucinated locators: the LLM produced an xpath that passes on the current page (because it peeked at it in context), but on tomorrow’s version of the page — pure fantasy.
- False-green tests: auto-heal changed an assertion from “$100” to “$200” — that was a real regression. This is the most expensive class of bugs — green tests, broken prod.
- Regulatory / audit trail: if AI changes a test assertion in fintech or medtech — what did the QA team sign off on? In an audit the question “how exactly did you test this” needs a versioned answer.
- Vendor lock-in: NL tests in testRigor or Mabl can’t be migrated to Playwright without a rewrite. Cheap today, not tomorrow, and migration is expensive.
- Privacy: cloud-based AI platforms send DOM snapshots (read: user names and emails, PII) to their servers. In the EU this is a GDPR issue; in healthcare — HIPAA.
6. Where AI actually works in QA
Not where the marketing promises. From teams that have been using AI tools for a year or two:
- Test data and edge-case value generation.
- Bug report generation from failed runs (with reproduction steps, screenshot, assertion).
- Auto-categorisation of flaky tests (real bug vs env issue).
- PR previews — “what this test verifies, what risk it covers”.
- Explaining test failures to non-tech audiences (PM, product).
- Generating DB queries from NL descriptions to set up test state.
- Finding duplicate test cases in TestRail / Zephyr.
7. A one-sprint rollout plan
If you want to try this without a bet-the-farm approach:
- Turn Healenium on for non-critical suites (smoke on staging). Watch the approval rate for a week — what % of healings actually work.
- Bring Claude/ChatGPT into the team for test data generation, failed-run explanation, autotest code review.
- If there’s budget — pilot Mabl/testRigor on ONE UI flow. Compare TCO (license + setup + maintenance) to a Playwright equivalent over a year.
- NEVER turn on auto-accept for changed assertions. Healed locator — ok (after approve), changed assert — never.
- Audit trail: version “healed locators” like regular code via a PR in the test repo.
8. Checklist for AI in autotests
- Approval flow for healed locators (no auto-accept).
- Metric: % of actually useful healings vs false positives (track this).
- Cost per test / per month — real savings vs license.
- Audit trail for regulated industries (fintech, healthcare).
- Fallback to manual locators if the AI service is unavailable.
- PII policy: what data goes to cloud AI.
- Plan B for vendor exit — how much migration would cost.
The main AI benefit in QA 2026 is not “magic, tests heal themselves” — it’s speeding up the routine: test data, debugging, reports, code review. Auto-heal locators is a nice bonus, not a silver bullet. The teams that got real ROI usually started with Healenium and an LLM co-pilot, not with a $50k/year platform.