arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.20358cs.SE
收藏

超越基于LLM的测试自动化:一种利用DOM可访问性树提取的零成本自愈方法

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

Renjith Nelson Joseph

AI总结:

本文提出一种零成本自愈测试自动化框架,通过结构化可访问性树提取算法替代LLM发现,采用十级优先级定位层级,实现单次遍历生成稳健选择器,验证结果显示在31个测试组合中100%通过,执行时间仅22秒,且自愈机制在1秒内检测并重发现失效选择器。

摘要:

现代网页测试自动化框架严重依赖CSS选择器、XPath表达式和可见文本标签来定位UI元素。这些定位器本质上是脆弱的——当网页应用更新其DOM结构或类名时,测试套件会大规模失败。现有的自愈方法越来越多地将元素发现委托给大型语言模型(LLMs),引入了每运行一次API成本,这在企业规模上变得不可接受。本文提出了一种零成本自愈测试自动化框架,用结构化的可访问性树提取算法替代LLM发现。该框架采用十级优先级排序的定位层级——get_by_role(W3C标准)、data-testid、ARIA标签、CSS类片段、可见文本——从实时DOM中单次遍历生成稳健的选择器。自愈机制在失败时仅重新提取损坏的选择器,而不是重新运行完整发现。该框架在automationexercise.com上验证了三种设备配置(桌面Chrome、桌面Safari、iPhone 15)和十个业务流程测试工作流,采用三级层次结构(L0:领域,L1:流程,L2:功能)。结果表明,在31个测试组合中100%通过,总执行时间为22秒,在并行执行下。自愈机制被实证证明:失效的选择器在1秒内被检测并重新发现,无需人工干预。该框架可扩展到300多个测试用例,且无持续API成本。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑