接口自动化测试框架设计优化与实现

2021-04-22 17:09:01孙立哲
电脑知识与技术 2021年8期

摘要:随着浏览器技术的迭代更新,文档对象技术在一些主流浏览器版本中不再受支持,前期设计的轻量级接口自动化测试框架中结果统计分析与展示模块因而功能不能正常使用。基于此,本文对前期设计的轻量级接口自动化测试框架做了一定的设计优化,将用于记录测试用例及结果的XML文件结构设计优化为MySQL数据库表结构设计,将测试执行模块写数据入XML文件优化为写数据库表,将结果统计分析与展示模块由前端JS读取XML文件数据优化为后端JSP读取数据库表数据。经验证测试,优化后的测试框架不再受文档对象技术的限制,实用性更佳,能在较主流的几款浏览器中正常使用,是一种有效的技术替代方案。

關键词:自动化测试框架;设计优化;动态Web技术;JSP;MySQL

中图分类号 TP311      文献标识码:A

文章编号:1009-3044(2021)08-0212-03

Abstract: With the iterative update of technology, document object technology is no longer supported in some browsers, thus the function of the statistical analysis and presentation module in the interface automation test framework designed in the early stage is affected. Based on this, this paper made some optimization for the automation test framework, such as with MySQL database table structure design replacing the XML file, with writing data into database table replacing into file, with reading data from database table by back-end JSP replacing from file by front-end JS. The optimized test framework is no longer limited by browser document object technology and has better usability, could be used in a few more mainstream browsers and is an effective technical alternative.

Key words: automation test framework; design optimization; dynamical Web technology; JSP; MySQL

前期针对某后端服务产品接口多、内部处理逻辑复杂且版本迭代频繁的情况,为了实现短时间快速测试,基于面向对象技术、Web开发技术等设计并实现了一套较实用的轻量级接口自动化测试框架[1]。该框架由两大部分组成,一是基于面向对象技术和XML文档DOM开发等技术的自动化测试执行模块,主要实现了对测试数据批量配置、测试脚本设计、测试脚本批量执行以及自动生成XML格式的测试结果数据文件。另一部分是集XML、HTML、CSS和JS等集成开发技术的测试结果统计分析与展示模块,主要实现对测试结果文件内数据的统计分析并以Web页面形式作个性化展示。……

登录APP查看全文