Towards Automated Page Object Generation for Web Testing using Large Language Models
Preprint
Abstract
Page Objects (POs) are a widely adopted design pattern for improving the maintainability and scalability of automated end-to-end web tests. However, creating and maintaining POs is still largely a manual, labor-intensive activity, while automated solutions have seen limited practical adoption. In this context, the potential of Large Language Models (LLMs) for these tasks has remained largely unexplored. This paper presents an empirical study on the feasibility of using LLMs, specifically GPT-4o and DeepSeek Coder, to automatically generate POs for web testing. We evaluate the generated artifacts on an existing benchmark of five web applications for which manually written POs are available (the ground truth), focusing on accuracy (i.e., the proportion of ground truth elements correctly identified) and element recognition rate (i.e., the proportion of ground truth elements correctly identified or marked for modification). Our results show that LLMs can generate syntactically correct and functionally useful POs with accuracy values ranging from 32.6% to 54.0% and element recognition rate exceeding 70% in most cases. Our study contributes the first systematic evaluation of LLMs strengths and open challenges for automated PO generation, and provides directions for further research on integrating LLMs into practical testing workflows.Keywords
All Related Versions
This publication has 9 references indexed in Scilit:
- Large Language Models for Automated Web-Form-Test Generation: An Empirical StudyACM Transactions on Software Engineering and Methodology, 2026
- A multi-year grey literature review on AI-assisted test automationInformation and Software Technology, 2025
- An Empirical Study of the Non-Determinism of ChatGPT in Code GenerationACM Transactions on Software Engineering and Methodology, 2025
- Lost in the Middle: How Language Models Use Long ContextsTransactions of the Association for Computational Linguistics, 2024
- A Survey on the Use of Computer Vision to Improve Software Engineering TasksIEEE Transactions on Software Engineering, 2020
- Three Open Problems in the Context of E2E Web Testing and a Vision: NEONATE2019
- APOGEN: automatic page object generator for web testingSoftware Quality Journal, 2016
- Robula+: an algorithm for generating robust XPath locators for web testingJournal of Software: Evolution and Process, 2016
- Approaches and Tools for Automated End-to-End Web Testing2016