Generating and selecting resilient and maintainable locators for Web automated testing. (31st January 2021) - Nguyen, Vu; To, Thanh; Diep, Gia‐Han
Summary: Web user interface (UI) test automation strategies have been dominated by programmable and record–playback approaches. Of these, record–playback allows creating automation tests easily and reduces the cost of test generation. However, this approach increases the cost of test maintenance due to its unstable generated locators for identifying UI objects during playback. In this paper, we propose a new approach to generating and selecting resilient and maintainable locators. Our approach consists of two parts, a new XPath construction method and selecting the best XPath to locate the target element. Our XPath construction method relies on semantic structures of Web pages to locate the target element using its neighbors. We conducted an experiment on 15 popular websites. The results show that our approach outperforms the state‐of‐the‐practice/art Selenium IDE and Robula+ in locating target elements by effectively avoiding wrong locators. It also produces more readable XPaths (hence more maintainable tests) than do these approaches. Abstract : This paper presents a new approach to generating and selecting resilient and maintainable locators for Web UI test automation. The approach consists of a method to construct locators of a Web element based on its neighbors and an algorithm to select resilient locators. Our experiment using 2, 293 UI elements of 15 popular websites shows the proposed approach outperforming the state‐of‐the‐practice/art Selenium IDE and Robula+ in reducing false positives in locating target elements during automation test execution.