Sidereal: Statistical adaptive generation of robust locators for web testing. (25th April 2021) - Leotta, Maurizio; Ricca, Filippo; Tonella, Paolo
Summary: By ensuring adequate functional coverage, End‐to‐End (E2E) testing is a key enabling factor of continuous integration. This is even more true for web applications, where automated E2E testing is the only way to exercise the full stack used to create a modern application. The test code used for web testing usually relies on DOM locators, often expressed as XPath expressions, to identify the web elements and to extract the data checked in assertions. When applications evolve, the most dominant cost for the evolution of test code is due to broken locators, which fail to locate the target element in the novel versions and must be repaired. In this paper, we formulate the robust XPath locator generation problem as a graph exploration problem, instead of relying on ad‐hoc heuristics as the one implemented by the state of the art tool robula+ . Our approach is based on a statistical adaptive algorithm implemented by the tool sidereal, which outperforms robula+ 's heuristics in terms of robustness by learning the potential fragility of HTML properties from previous versions of the application under test. sidereal was applied to six applications and to a total of 611 locators and was compared against two baseline algorithms, robula+ and Montoto. The adoption of sidereal results in a significant reduction of the number of broken locators (respectively ‐55% and ‐70%). The time for generating such robust locators was deemed acceptable being in the order of hundredths of second. Abstract : When web applications evolve the most dominant cost for the evolution of test code, used for automated web testing, is often due to broken locators, which fail to locate the target element in the novel version. In this paper, we propose Sidereal, a statistical adaptive locator generator based on weights learnt on the history of the target application which outperforms state‐of‐the‐art Robula+ generator in terms of robustness.