Table of Contents
Fetching ...

Beyond LLM-based test automation: A Zero-Cost Self-Healing Approach Using DOM Accessibility Tree Extraction

Renjith Nelson Joseph

Abstract

Modern web test automation frameworks rely heavily on CSS selectors, XPath expressions, and visible text labels to locate UI elements. These locators are inherently brittle -- when web applications update their DOM structure or class names, test suites fail at scale. Existing self-healing approaches increasingly delegate element discovery to Large Language Models (LLMs), introducing per-run API costs that become prohibitive at enterprise scale. This paper presents a zero-cost self-healing test automation framework that replaces LLM-based discovery with a structured accessibility tree extraction algorithm. The framework employs a ten-tier priority-ranked locator hierarchy -- get_by_role (W3C standard), data-testid, ARIA labels, CSS class fragments, visible text -- to discover robust selectors from a live DOM in a single one-time pass. A self-healing mechanism re-extracts only broken selectors upon failure, rather than re-running full discovery. The framework is validated against automationexercise.com across three device profiles (Desktop Chrome, Desktop Safari, iPhone 15) and ten business process test workflows under a three-tier hierarchy (L0: Domain, L1: Process, L2: Feature). Results demonstrate a 31/31 (100%) pass rate across 31 test combinations with total execution time of 22 seconds under parallel execution. Self-healing is empirically demonstrated: a stale selector is detected and re-discovered in under 1 second with zero human intervention. The framework scales to 300+ test cases with zero ongoing API cost.

Beyond LLM-based test automation: A Zero-Cost Self-Healing Approach Using DOM Accessibility Tree Extraction

Abstract

Modern web test automation frameworks rely heavily on CSS selectors, XPath expressions, and visible text labels to locate UI elements. These locators are inherently brittle -- when web applications update their DOM structure or class names, test suites fail at scale. Existing self-healing approaches increasingly delegate element discovery to Large Language Models (LLMs), introducing per-run API costs that become prohibitive at enterprise scale. This paper presents a zero-cost self-healing test automation framework that replaces LLM-based discovery with a structured accessibility tree extraction algorithm. The framework employs a ten-tier priority-ranked locator hierarchy -- get_by_role (W3C standard), data-testid, ARIA labels, CSS class fragments, visible text -- to discover robust selectors from a live DOM in a single one-time pass. A self-healing mechanism re-extracts only broken selectors upon failure, rather than re-running full discovery. The framework is validated against automationexercise.com across three device profiles (Desktop Chrome, Desktop Safari, iPhone 15) and ten business process test workflows under a three-tier hierarchy (L0: Domain, L1: Process, L2: Feature). Results demonstrate a 31/31 (100%) pass rate across 31 test combinations with total execution time of 22 seconds under parallel execution. Self-healing is empirically demonstrated: a stale selector is detected and re-discovered in under 1 second with zero human intervention. The framework scales to 300+ test cases with zero ongoing API cost.
Paper Structure (40 sections, 1 figure, 9 tables)

This paper contains 40 sections, 1 figure, 9 tables.

Figures (1)

  • Figure 1: Three-layer framework architecture. The Workflow Layer (green) contains L0/L1/L2 business process test files. The Function Layer (purple) provides reusable page actions. The Engine Layer (blue) contains smart_find.py (self-healing finder), dom_extractor.py (accessibility tree extractor), and the global locator cache. Playwright drives the browser against the target site across device profiles.