Back to Search Start Over

SleepReplacer: a novel tool-based approach for replacing thread sleeps in selenium WebDriver test code.

Authors :
Olianas, Dario
Leotta, Maurizio
Ricca, Filippo
Source :
Software Quality Journal; Dec2022, Vol. 30 Issue 4, p1089-1121, 33p
Publication Year :
2022

Abstract

Assuring quality of web applications is fundamental, given their relevance in the today's world. A possible way to reach this goal is through end-to-end (E2E) testing, an approach in which a web application is automatically tested by performing the actions that a user would do. With modern web applications (for example, single-page applications), it is of great importance to properly handle asynchronous calls in the test suite. In E2E Selenium WebDriver test suites, asynchronous calls are usually managed in two ways: using thread sleeps or explicit waits. The first is easier to use, but is inefficient and can lead to instability (also called flakiness, a problem often present in test suites that makes us lose confidence in the testing phase), while the second is usually more efficient but harder to use because, if the correct kind of wait is not carefully selected, it can introduce flakiness too. To help Testers, who often opt for the first strategy, we present in this work a tool-based approach to automatically replace thread sleeps with explicit waits in an E2E Selenium WebDriver test suite without introducing new flakiness. We empirically validated our tool named SleepReplacer on four different test suites, and we found that it can correctly replace in an automatic way from 81 to 100% of thread sleeps, leading to a significant reduction of the total execution time of the test suite (i.e., from 13 to 71%). [ABSTRACT FROM AUTHOR]

Details

Language :
English
ISSN :
09639314
Volume :
30
Issue :
4
Database :
Complementary Index
Journal :
Software Quality Journal
Publication Type :
Academic Journal
Accession number :
160371744
Full Text :
https://doi.org/10.1007/s11219-022-09596-z