arXiv(opens in a new tab)cs.SEOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.25601

Step-Aligned Script Generation with Verification and Recovery for Web Automation Testing

Hridya Dhulipala, Xiaokai Rong, Aashish Yadavally, Tien N. Nguyen

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Hridya Dhulipala

Department of Computer Science

The University of Texas at Dallas

Dallas, USA

hridya.dhulipala@utdallas.edu

Aashish Yadavally

Department of Computer Science

The University of Central Florida

Orlando, USA

aashish.yadavally@ucf.edu

Xiaokai Rong

Department of Computer Science

The University of Texas at Dallas

Dallas, USA

xiaokai.rong@utdallas.edu

Tien N. Nguyen

Department of Computer Science

The University of Texas at Dallas

Dallas, USA

tien.n.nguyen@utdallas.edu

Abstract—Automated generation of end-to-end web tests remains costly: developers must identify stable selectors, encode multi-step workflows, attach assertions, and maintain scripts as interfaces evolve. Recent LLM-based web agents can complete natural-language tasks in a live browser session, but task completion is not the same as producing a testware artifact - code that is executable, replayable from a reset state, inspectable by developers, and tied to an oracle. We present TESSARA, an adaptive test-script generation framework that converts natural-language test intent into Playwright scripts consisting of executable interaction code, goal-state assertions, and step-level provenance linking each step to its generated code fragment, selector evidence, execution outcome, and repair history. TESSARA grounds each planned step via Step-Aligned Scripting (SAS), enabling fine-grained failure localization, selective regeneration of failing suffixes, and reversibility-aware backtracking that avoids undoing likely commit points (e.g., form submissions). A three-level verification pipeline (syntactic, execution, and semantic/oracle), detects and repairs malformed code, interaction failures, and incorrect landing states. We evaluate TESSARA on three public web benchmarks, measuring script executability, oracle satisfaction, replay stability, and repair efficiency, and show substantial improvements over baselines and underlying VLMs used directly as script generators.

I. INTRODUCTION

Web applications are central to modern software systems, and end-to-end (E2E) testing is a standard part of their quality-assurance pipeline. E2E tests encode user-visible requirements as executable browser interactions (logging in, searching, filling forms, navigating workflows) and are routinely run in CI/CD pipelines to catch regressions before release. Writing such tests, however, remains expensive and brittle: developers must manually identify stable UI elements, encode the interaction sequence, attach assertions that check the test actually validates the intended behavior, and revise scripts whenever dynamic interface behavior breaks them failures [1]. These costs are amplified in modern web applications, where dynamic DOMs, asynchronous loading, and non-standard widgets routinely invalidate scripts written against a snapshot of the UI. Frameworks such as Playwright [2] or Selenium [3] provide the execution substrate, but authoring and maintaining the scripts that run on them is still largely manual.

A second challenge is handling failures in test scripts. In a testing environment, a failure when executing test scripts is diagnostic information about where a script is fragile and what needs to be repaired. Existing approaches to web interaction largely treat failures uniformly [4]. Retrying a step or regenerating an entire trajectory without attributing the failure to a specific action, selector, or assumption about the page state. For a testing tool, this is a missed opportunity. To elaborate, if a step in the script breaks because a selector changed, a developer (or an automated program repair tool) should be able to localize the fix to that step, inspect why it failed, and regenerate only the affected code fragment — preserving the rest of the script as a still-valid regression test. Treating the whole script as atomic discards exactly the information a maintainable test suite needs.

We present TESSARA, an adaptive test-script synthesis framework that converts natural-language testing intent into executable, replayable, and repairable Playwright tests. Given a testing goal, TESSARA first decomposes it into a sequence of high-level interaction steps, then grounds each step into an executable code fragment via Step-Aligned Scripting (SAS), maintaining an explicit, persistent alignment between each semantic step and the code that implements it. This alignment is what makes the output a testing artifact rather than a transcript. It supports step-level failure localization, selective regeneration of only the failing suffix of a script (preserving validated prefix steps as reusable test fragments), and reversibility-aware backtracking that avoids undoing actions with likely durable side effects (e.g., form submissions, payments).

To assess the correctness of a generated test script, TESSARA applies a three-level verification pipeline. At the syntactic level, generated fragments are checked and repaired against compiler/runtime feedback before they are executed.

on the browser. At the execution level, each fragment is run, monitored and logged, so failures are attributed to the step that caused them rather than the script as a whole. At the semantic level, an oracle check evaluates whether the resulting page state is actually consistent with the testing intent. This addresses a failure specific to testing tools, where a script can execute without crashing yet land on the wrong page, producing a script that always "passes" without succeeding.

In summary, this paper makes the following contributions:

(1) TESSARA, a framework for generating executable web automation scripts from natural-language task descriptions via planning, step-aligned scripting, verification, and recovery.

(2) Step-Aligned Scripting (SAS), which aligns high-level action steps with executable code fragments, enabling stepwise verification, failure localization, and effective backtracking.

(3) A structured verification and recovery, combining a 3-level stack (syntactic, semantic, and execution) with reversibility-aware backtracking to support targeted repair during script generation.

(4) Empirical evaluation: to show TESSARA’s effectiveness in generating accurate and executable web test scripts.

References (38)