Using Multi-Locators to Increase the Robustness of Web Test Cases

Maurizio Leotta, Andrea Stocco, Filippo Ricca, Paolo Tonella
2015 2015 IEEE 8th International Conference on Software Testing, Verification and Validation (ICST)  
The main reason for the fragility of web test cases is the inability of web element locators to work correctly when the web page DOM evolves. Web elements locators are used in web test cases to identify all the GUI objects to operate upon and eventually to retrieve web page content that is compared against some oracle in order to decide whether the test case has passed or not. Hence, web element locators play an extremely important role in web testing and when a web element locator gets broken
more » ... evelopers have to spend substantial time and effort to repair it. While algorithms exist to produce robust web element locators to be used in web test scripts, no algorithm is perfect and different algorithms are exposed to different fragilities when the software evolves. Based on such observation, we propose a new type of locator, named multi-locator, which selects the best locator among a candidate set of locators produced by different algorithms. Such selection is based on a voting procedure that assigns different voting weights to different locator generation algorithms. Experimental results obtained on six web applications, for which a subsequent release was available, show that the multilocator is more robust than the single locators (about -30% of broken locators w.r.t. the most robust kind of single locator) and that the execution overhead required by the multiple queries done with different locators is negligible (2-3% at most).
doi:10.1109/icst.2015.7102611 dblp:conf/icst/LeottaSRT15 fatcat:a3uxeda34rcdzfk6pvpbkrtrnu