当前位置: X-MOL 学术Softw. Test. Verif. Reliab. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Generating and selecting resilient and maintainable locators for Web automated testing
Software Testing, Verification and Reliability ( IF 1.5 ) Pub Date : 2021-01-31 , DOI: 10.1002/stvr.1760
Vu Nguyen 1, 2, 3 , Thanh To 1, 2 , Gia‐Han Diep 2
Affiliation  

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.

中文翻译:

生成并选择有弹性且可维护的定位器以进行Web自动化测试

Web用户界面(UI)测试自动化策略已被可编程和记录回放方法所主导。其中,记录回放可轻松创建自动化测试,并降低测试生成成本。但是,由于这种方法在回放过程中会不稳定地生成用于标识UI对象的定位器,因此增加了测试维护的成本。在本文中,我们提出了一种生成和选择弹性且可维护的定位器的新方法。我们的方法包括两部分,一个是新的XPath构造方法,另一个是选择最佳XPath来定位目标元素。我们的XPath构造方法依赖于网页的语义结构来使用目标元素的邻居来定位目标元素。我们在15个热门网站上进行了实验。结果表明,通过有效地避免错误的定位器,我们的方法在定位目标元素方面优于当前的Selenium IDE和Robula +。与这些方法相比,它还产生了更具可读性的XPath(因此更具可维护性的测试)。
更新日期:2021-01-31
down
wechat
bug