Similarity-based Web Element Localization for Robust Test Automation
Journal article, 2023

Non-robust (fragile) test execution is a commonly reported challenge in GUI-based test automation, despite much research and several proposed solutions. A test script needs to be resilient to (minor) changes in the tested application but, at the same time, fail when detecting potential issues that require investigation. Test script fragility is a multi-faceted problem. However, one crucial challenge is how to reliably identify and locate the correct target web elements when the website evolves between releases or otherwise fail and report an issue. This article proposes and evaluates a novel approach called similarity-based web element localization (Similo), which leverages information from multiple web element locator parameters to identify a target element using a weighted similarity score. This experimental study compares Similo to a baseline approach for web element localization. To get an extensive empirical basis, we target 48 of the most popular websites on the Internet in our evaluation. Robustness is considered by counting the number of web elements found in a recent website version compared to how many of these existed in an older version. Results of the experiment show that Similo outperforms the baseline; it failed to locate the correct target web element in 91 out of 801 considered cases (i.e., 11%) compared to 214 failed cases (i.e., 27%) for the baseline approach. The time efficiency of Similo was also considered, where the average time to locate a web element was determined to be 4 milliseconds. However, since the cost of web interactions (e.g., a click) is typically on the order of hundreds of milliseconds, the additional computational demands of Similo can be considered negligible. This study presents evidence that quantifying the similarity between multiple attributes of web elements when trying to locate them, as in our proposed Similo approach, is beneficial. With acceptable efficiency, Similo gives significantly higher effectiveness (i.e., robustness) than the baseline web element localization approach.

test case robustness

XPath locators

Additional Key Words and PhrasesGUI testing

web element locators

test automation

Author

Michel Nass

Blekinge Tekniska Högskola, BTH

Emil Alégroth

Blekinge Tekniska Högskola, BTH

Robert Feldt

Chalmers, Computer Science and Engineering (Chalmers), Software Engineering (Chalmers)

Blekinge Tekniska Högskola, BTH

Maurizio Leotta

University of Genoa

Filippo Ricca

University of Genoa

ACM Transactions on Software Engineering and Methodology

1049-331X (ISSN) 15577392 (eISSN)

Vol. 32 3 75

BaseIT -- Basing Software Testing on Information Theory

Swedish Research Council (VR) (2015-04913), 2016-01-01 -- 2019-12-31.

Automated boundary testing for QUality of Ai/ml modelS (AQUAS)

Swedish Research Council (VR) (2020-05272), 2021-01-01 -- 2024-12-31.

Subject Categories

Tribology

Computer Science

Computer Systems

DOI

10.1145/3571855

More information

Latest update

10/27/2023