Intellectual model for generating adaptive WEB selectors based on GNN
DOI:
https://doi.org/10.31649/1681-7893-2025-50-2-142-149Keywords:
software, information technology, intelligent systems, automated testing, graph neural networks (GNN)Abstract
The article discusses the problem of DOM selector instability, which is one of the key reasons for flaky tests in modern automated web resource testing systems. It is shown that traditional approaches to selector formation, both manual and automated, do not take into account the global context of the DOM structure and are ineffective in the case of dynamic interface changes. The feasibility of using graph neural networks (GNN) as a tool for modelling the DOM tree in the form of a directed graph, taking into account the semantic, attributive, and structural features of nodes, is justified.
A theoretical model for building adaptive DOM selectors, combining GNN with a decision-making agent, is proposed. A mathematical representation of the DOM graph, a system of node features (one-hot tag encoding, binary attributes id/class/data-testid, depth, number of descendants, position among neighbours) has been developed, and selector evaluation metrics have been formalised: uniqueness, accuracy, completeness, F1-measure and length. An agent reward function has been formed that optimises the balance between accuracy, stability, and compactness of the selector.
It has been shown that the combination of DOM (Document object model) graph representations and a decision optimisation mechanism allows the creation of selectors that are resistant to structural changes in web pages and reduces the need for manual test maintenance. The proposed model forms the theoretical basis for the creation of intelligent automated testing systems capable of adapting locators during DOM changes without the need for a complete analysis of the interface by the tester.
References
Lawson, R. Web Scrapping with Python; Packt Publishing: Birmingham, UK, 2015
K. Parikh, D. Singh, D. Yadav, and M. Rathod, “Detection of web scraping using machine learning,” Open access international journal of Science and Engineering, pp. 114–118, 2018.
Kipf, T. N. & Welling, M. Semi-supervised classification with graph convolutional networks. International Conference on Learning Representations (2017). DOI:
https://doi.org/10.48550/arXiv.1609.02907.
Veličković, P. et al. Graph attention networks. International Conference on Learning Representations (ICLR, 2017). DOI: https://doi.org/10.48550/arXiv.1710.10903.
Jianan Zhao, Xiao Wang, Chuan Shi, Binbin Hu, Guojie Song, and Yanfang Ye. 2021. Heterogeneous graph structure learning for graph neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence. 4697–4705. DOI: https://doi.org/10.1609/aaai.v35i5.16600.
Zheng Y, Liu Y, Xie X, et al. Automatic web testing using curiosity-driven reinforcement learning. In: Proceedings of the 43rd International Conference on Software Engineering, 2021. 423–435. DOI: https://doi.org/10.48550/arXiv.2103.06018.
Vu Nguyen, Thanh To, and Gia-Han Diep. 2021. Generating and selecting resilient and maintainable locators for Web automated testing. Software Testing, Verification and Reliability 31, 3 (2021), e1760. DOI: https://doi.org/10.1002/stvr.1760.
Nguyen, L. M., Hui, S. C., & Fong, C. A. (2013). Large-scale multiobjective static test generation for web-based testing with integer programming. IEEE Transactions on Learning Technologies, (1), 46–59. DOI: https://doi.org/10.1109/TLT.2012.22.
M. T. Taky, Automated Testing With Cypress. PhD thesis, 2021.
Sanjay Dutta, What is One-hot Encoding in Machine Learning? A Comperehesive Guide with examples. Medium. Режим доступу https://medium.com/@sanjay_dutta/what-is-one-hot-encoding-in-machine-learning-a-comprehensive-guide-with-examples-090f037a6bbe
B. Yeoh and H. Wang, “Grown+ up: A “graph representation of a webpage ” network utilizing pre-training,” in Proceedings of the 31st ACM International Conference on Information & Knowledge Management, pp. 2372–2382, 2022. DOI: https://doi.org/10.1145/3511808.3557340.
Sheng Jia, Jamie Kiros, Jimmy Ba, “DOM-Q-NET: Grounded RL on Structured Language”. International Conference on Learning Representations (2017). DOI:
https://doi.org/10.48550/arXiv.1902.07257
Y. Lan, Y. Lu, Z. Li, M. Pan, W. Yang, T. Zhang, and X. Li, “Deeply reinforcing android gui testing with deep reinforcement learning,” in Proceedings of the 46th IEEE/ACM International Conference on Software Engineering, 2024, pp. 1–13. DOI: https://doi.org/10.1145/3597503.3623344
Ali Hassaan Mughal. 2025. An Autonomous RL Agent Methodology for Dynamic Web UI Testing in a BDD Framework. DOI: https://doi.org/10.48550/arXiv.2503.08464
Downloads
-
PDF (Українська)
Downloads: 0
Published
How to Cite
Issue
Section
License
Автори, які публікуються у цьому журналі, погоджуються з наступними умовами:- Автори залишають за собою право на авторство своєї роботи та передають журналу право першої публікації цієї роботи на умовах ліцензії Creative Commons Attribution License, котра дозволяє іншим особам вільно розповсюджувати опубліковану роботу з обов'язковим посиланням на авторів оригінальної роботи та першу публікацію роботи у цьому журналі.
- Автори мають право укладати самостійні додаткові угоди щодо неексклюзивного розповсюдження роботи у тому вигляді, в якому вона була опублікована цим журналом (наприклад, розміщувати роботу в електронному сховищі установи або публікувати у складі монографії), за умови збереження посилання на першу публікацію роботи у цьому журналі.
- Політика журналу дозволяє і заохочує розміщення авторами в мережі Інтернет (наприклад, у сховищах установ або на особистих веб-сайтах) рукопису роботи, як до подання цього рукопису до редакції, так і під час його редакційного опрацювання, оскільки це сприяє виникненню продуктивної наукової дискусії та позитивно позначається на оперативності та динаміці цитування опублікованої роботи (див. The Effect of Open Access).