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

[Person b0e97136-fbe0-4232-a8b7-6fa89ee16d59 not found]

Blekinge Tekniska Högskola, BTH

[Person 7be492ae-6526-4bb8-a7c8-120e7e2d9f66 not found]

Blekinge Tekniska Högskola, BTH

[Person 2603f7f3-af9c-4b9c-b7fa-83fec555fac4 not found]

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

Blekinge Tekniska Högskola, BTH

[Person a1af4b1a-1cc9-4470-a0dc-d739ac6869ab not found]

University of Genoa

[Person d0d4a676-e77e-438d-bd06-0212e52d0e8d not found]

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 (SSIF 2011)

Tribology

Computer Science

Computer Systems

DOI

10.1145/3571855

More information

Latest update

10/27/2023