摘要
在软件测试领域,自动化测试的研究层出不穷,而新技术的发展,给自动化测试提供了更多的方向,而UI自动化测试的需求更是繁多。该文从Electron应用出发,针对界面元素id无法提取的情况,设计并实现了一种位图识别的自动化测试方案,以Opencv的图像识别算法为支撑,以Sikulix的库函数为底层驱动,应用Python+RF实现了各个模块的设计以及整个测试框架集成。实验结果表明,元素识别率可以达到96.8%以上,在这种场景下是元素id识别的完美替代,且丰富的API保证了复杂需求实现的可行性,通过项目的实际应用效果以及输出的代码文档示例,证实了其应用价值。
In the field of software testing,the research of automated testing emerges in endlessly.The development of new technology provides more directions for automated testing,and the demand of UI automated testing is more numerous.Starting from the application of electron and aiming at the situation that the ID of interface element can not be extracted,this paper designs and implements an automatic test scheme for bitmap recognition.Supported by the image recognition algorithm of opencv,driven by the library function of sikulix,the design of each module and the integration of the whole test framework are realized by python+RF.The experimental results show that the recognition rate of elements can reach more than 96.8%.In this scenario,it is a perfect substitute for element ID recognition,and rich API ensures the feasibility of implementing complex requirements.We verify its application value through the practical application effect of the project and the output code document.
作者
余锦润
杨丹君
李波波
YU Jin-run;YANG Dan-jun;LI Bo-bo(Zhejiang SUPC0N Technology Co.,Ltd.,Hangzhou 310053,China)
出处
《自动化与仪表》
2021年第3期90-94,共5页
Automation & Instrumentation
基金
工信部2018年工业互联网创新发展工程项目。