摘要
基于提高对OpenStack Horizon的基本功能进行频繁测试的测试效率,节省测试成本的目的,通过研究Selenium测试工具进行Web自动化测试的原理和方法,在其基础上对其WebDriver组件的部分API进行封装,使用PyUnit框架编写测试用例并整合成测试用例集,通过单独的配置文件实现代码与数据相分离,并将元素定位全部放在单独文件,最后引入HTMLTestRunner模块用于生成html格式测试报告,从而形成了完整的自动化测试系统。通过将此系统应用于Horizon的自动化测试,能够更快地完成预期的测试任务并得到相应的测试报告,实现了对OpenStack的自动化测试,测试效率提高了50%以上。
Based on the purpose of improving the test efficiency of the basic functions of OpenStack Horizon and saving the cost of testing,some of the APIs of WebDriver components are encapsulated on the basis of studying the principle and method of Web automation test by Selenium testing tools.The PyUnit framework prepares the test case and integrates it into test case suites,separating the code from the data through a separate configuration file,placing the element in a separate file,and finally introducing the HTMLTestRunner module to generate the html format test report,resulting in a complete Automated test system.By applying this system to Horizon's automated testing,it is possible to complete the expected test tasks faster and get the corresponding test reports,enabling automated testing of OpenStack and improved test efficiency by more than 50%.
出处
《国外电子测量技术》
2017年第5期45-49,共5页
Foreign Electronic Measurement Technology