Beyond LLM-based test automation: A Zero-Cost Self-Healing Approach Using DOM Accessibility Tree Extraction
New method eliminates LLM API costs while achieving 100% pass rate across 31 test combinations.
A new research paper proposes a paradigm shift in web test automation by eliminating dependency on costly Large Language Models (LLMs) for self-healing. Authored by Renjith Nelson Joseph, the framework tackles the core problem of brittle test selectors—CSS and XPath locators that break when web applications update. Instead of querying an LLM API for every element discovery, which incurs prohibitive per-run costs at scale, the system performs a single, structured extraction of the DOM's accessibility tree.
This extraction uses a ten-tier, priority-ranked locator hierarchy that prioritizes W3C-standard methods like `get_by_role`, followed by developer-friendly `data-testid` attributes, ARIA labels, and finally CSS class fragments and visible text. This creates a robust map of the UI. When a test fails due to a broken selector, the self-healing mechanism kicks in, re-extracting only that specific failed locator from the live DOM instead of re-running a full, expensive discovery pass.
The framework was rigorously validated against a live e-commerce site across three device profiles (Desktop Chrome, Desktop Safari, iPhone 15) and ten complex business workflows. The results were striking: a 100% pass rate across 31 test combinations, with total parallel execution completing in just 22 seconds. Critically, the paper demonstrates that a stale selector can be detected and automatically re-discovered in under 1 second, with zero human intervention. This approach scales to over 300 test cases while maintaining a zero-dollar ongoing API cost, presenting a compelling, cost-effective alternative for enterprise test suites.
- Eliminates LLM API costs by using a structured 10-tier locator hierarchy (get_by_role, data-testid, ARIA labels) extracted from the DOM accessibility tree.
- Achieved 100% pass rate (31/31 tests) in 22 seconds and heals broken selectors in under 1 second with zero human intervention.
- Scales to 300+ test cases with zero ongoing cost, solving the prohibitive expense of LLM-based self-healing at enterprise scale.
Why It Matters
Enables large-scale, resilient UI test automation without the variable and often prohibitive costs associated with LLM API calls.