arXiv:2511.15168cs.SEcs.AI2025-11

用大模型生成可执行的网页表单测试脚本,提升自动化测试质量。

Finetuning LLMs for Automatic Form Interaction on Web-Browser in Selenium Testing Framework

  • 基于合成与人工标注数据训练模型,生成符合Selenium语法的测试脚本。
  • 在语法正确性、可执行性和字段覆盖度上超越GPT-4o等主流模型。
  • 首次构建公开数据集与评估基准,助力大模型驱动的自动化测试研究。

自动化网页应用测试是现代软件开发的关键环节,Selenium等框架通过浏览器自动化验证功能。其中,与网页表单交互并验证是核心任务,需生成语法正确、可执行且覆盖全面的脚本。尽管重要,该任务在大语言模型(LLMs)领域仍缺乏系统研究,且无公开基准或数据集。本文提出一种新方法,训练LLMs生成高质量Selenium测试脚本,聚焦表单交互。我们构建了包含真实世界表单与测试场景的合成及人工标注数据集,并定义了语法正确性、脚本可执行性与输入字段覆盖率等明确指标。实证研究表明,该方法在所有指标上均显著优于GPT-4o及其他主流模型。本工作为基于大模型的网页测试研究奠定基础,并提供可用资源以推动该领域持续发展。

原文摘要 · Abstract (English)

Automated web application testing is a critical component of modern software development, with frameworks like Selenium widely adopted for validating functionality through browser automation. Among the essential aspects of such testing is the ability to interact with and validate web forms, a task that requires syntactically correct, executable scripts with high coverage of input fields. Despite its importance, this task remains underexplored in the context of large language models (LLMs), and no public benchmark or dataset exists to evaluate LLMs on form interaction generation systematically. This paper introduces a novel method for training LLMs to generate high-quality test cases in Selenium, specifically targeting form interaction testing. We curate both synthetic and human-annotated datasets for training and evaluation, covering diverse real-world forms and testing scenarios. We define clear metrics for syntax correctness, script executability, and input field coverage. Our empirical study demonstrates that our approach significantly outperforms strong baselines, including GPT-4o and other popular LLMs, across all evaluation metrics. Our work lays the groundwork for future research on LLM-based web testing and provides resources to support ongoing progress in this area.

大模型自动化测试Selenium表单交互

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。