Erratum: Leveraging Flexible Tree Matching to Repair Broken Locators in Web Automation Scripts

Sacha Brisset,Romain Rouvoy,Lionel Seinturier,Renaud Pawlak
DOI: https://doi.org/10.48550/arXiv.2106.04916
2021-06-09
Abstract:Web applications are constantly evolving to integrate new features and fix reported bugs. Even an imperceptible change can sometimes entail significant modifications of the Document Object Model (DOM), which is the underlying model used by browsers to render all the elements included in a web application. Scripts that interact with web applications (e.g. web test scripts, crawlers, or robotic process automation) rely on this continuously evolving DOM which means they are often particularly fragile. More precisely, the major cause of breakages observed in automation scripts are element locators, which are identifiers used by automation scripts to navigate across the DOM. When the DOM evolves, these identifiers tend to break, thus causing the related scripts to no longer locate the intended target elements. For this reason, several contributions explored the idea of automatically repairing broken locators on a page. These works attempt to repair a given broken locator by scanning all elements in the new DOM to find the most similar one. Unfortunately, this approach fails to scale when the complexity of web pages grows, leading either to long computation times or incorrect element repairs. This article, therefore, adopts a different perspective on this problem by introducing a new locator repair solution that leverages tree matching algorithms to relocate broken locators. This solution, named Erratum, implements a holistic approach to reduce the element search space, which greatly eases the locator repair task and drastically improves repair accuracy. We compare the robustness of Erratum on a large-scale benchmark composed of realistic and synthetic mutations applied to popular web applications currently deployed in production. Our empirical results demonstrate that Erratum outperforms the accuracy of WATER, a state-of-the-art solution, by 67%.
Software Engineering
What problem does this paper attempt to address?
The problem that this paper attempts to solve is that element locators in automation scripts are prone to failure during the continuous evolution of web applications. Specifically: - **Problem Background**: Web applications keep changing in order to integrate new features and fix reported bugs. Even very small changes may lead to significant modifications to the underlying Document Object Model (DOM). This makes automation scripts that rely on the DOM (such as web test scripts, crawlers, or robotic process automation) very fragile, especially the element locators (identifiers used to navigate the DOM). When the DOM changes, these identifiers often become invalid, causing related scripts to no longer be able to locate target elements. - **Shortcomings of Existing Solutions**: Existing solutions usually try to fix invalid locators by scanning all elements in the new DOM to find the most similar one. However, this method is difficult to scale when the complexity of web pages increases, resulting in excessive computation time or inaccurate element repair. - **Solution Proposed in the Paper**: This paper proposes a new locator repair scheme - Erratum, which uses a tree - matching algorithm to relocate invalid locators. Erratum adopts a holistic approach to reduce the element search space, thereby significantly improving repair accuracy. The paper evaluates the performance of Erratum through a large - scale benchmark test set. The results show that Erratum is superior to the current state - of - the - art solution WATER in both the accuracy and performance of locator repair, with an average accuracy improvement of 67%. In addition, the paper also discusses a new test architecture centered around Erratum, aiming to completely replace locator - based interactions, support more interactive and robust script editing, and is suitable for web testing, web crawling, and robotic process automation.