一句话:提出基于目标状态 DOM 差异的 Web GUI 测试等待策略,生成更鲁棒、代表性更强且低开销的测试。
Web GUI 自动化测试中,等待策略会显著影响测试性能,但现有方法要么等待预设时间,在动态环境中不可靠,要么仅等待特定条件成立,难以应对复杂测试场景。本文提出一种鲁棒等待策略:不再等待固定时间或某个元素可用,而是等待目标状态到达。该方法在期望点捕获 Document Object Model(DOM),通过离线分析识别每两个连续测试动作所关联 DOM 之间的差异,并据此在自动生成测试时确定合适的等待时间。基于工业 Web 应用的评估表明,该方法生成的测试比传统等待策略更鲁棒,更能代表录制的使用场景,并在测试执行时间上保持高效、低开销。
Automated web GUI testing has been widely adopted since manual testing is time-consuming and tedious. Waiting strategy plays a vital role in automated web GUI testing since it significantly impacts the testing performance. Though important, little focus has been set on the waiting strategies in web GUI testing. Existing waiting strategies either wait for a predetermined time, which is not reliable in a dynamic environment, or only wait for a specific condition to be verified, which is often not robust enough to handle the complicated testing scenarios. In this work, we introduce a robust waiting strategy. Instead of waiting for a predetermined time or waiting for the availability of a particular element, our approach waits for a desired state to reach. This is achieved by capturing the Document Object Models (DOM) at the desired point, followed by an offline analysis to identify the differences between the DOMs associated with every two consecutive test actions. Such differences are used to determine the appropriate waiting time when automatically generating tests. Evaluation results with an industrial web application indicate that our approach produces more robust tests than the conventional waiting strategies used in web GUI testing. Furthermore, our generated tests are more representative of the recorded usage scenarios and are efficient with low overhead in test execution time.CCS CONCEPTS• Software and its engineering → Software testing and debugging
@inproceedings{ZhangLDSNSTS24,
title = {Towards a Robust Waiting Strategy for Web GUI Testing for an Industrial Software System},
author = {Haonan Zhang and Lizhi Liao and Zishuo Ding and Weiyi Shang and Nidhi Narula and Catalin Sporea and Andrei Toma and Sarah Sajedi},
booktitle = {ASE},
year = {2024},
doi = {10.1145/3691620.3695269}
}