Proceedings of the International scientific and practical conference ― Cambridge Science and Education Conference‖ (February 23-25, 2026) / Publisher website: www.naukainfo.com. – Cambridge, United Kingdom, 2026. - 289 p.
109 formalised approach to building selectors to ensure the stability of automated tests [1]. When creating a test, a specialist needs to analyse the part of the functionality that needs to be covered by the tests, select control elements, select actions on these elements, create a logical chain of actions to perform the test, and analyse the results [2]. Building a control element or selector is one of the most important aspects of creating and maintaining automated UI tests [3]. Their task is to help test launch drivers, such as Selenium Webdriver, as well as software libraries to interact with the DOM model [4, 5, 6]. Selectors should be easy to read in the program code and optimised as much as possible to speed up the tests themselves. The aim of the study is to analyse models and methods for evaluating the length of selectors for automated testing. Results The length of the selector is an important criteria when writing automated tests, as it performs several functions: - speeds up the execution of tests; - improves the stability of tests; - improves the understanding of the code. Several approaches can be used to determine the length of a selector, namely: determining the length of a selector by the number of characters, by the number of components, or using weighting coefficients for a more accurate determination of the length of a selector. As an experimental study, we will use an example of a selector for an element: div.container > form > input:nth-child(2) In this selector, we can see a hierarchy of three components, which includes: Tags – div, input form; class - .container; pseudo-class - :nth-child(2); embeddedness – «>».
Made with FlippingBook
RkJQdWJsaXNoZXIy MTAxMzIwNA==