关于项目自动化测试架构的改良计划 - DataProviderEngine架构

简介:

为了基于上文我们的xml文件的架构,对其进行解析,我自己写了一个DataProviderEngine作为解析xml文件的引擎,它主要的架构如下图:


具体细节如下,为了节省时间,我直接复制我的英文邮件内容了:

Step 1: The XMLReader read the raw test suite xml file (now we adopt the xml file ,since it is not binary file and easy to edit and version control)

Step 2: After reading ,XMLReader store the xml string into a string variable named “ originalXmlString “, this is our starting point.

Step 3: The XIncludeConverter read the originalXmlString ,and resolve the XInclude namespace ,when it resolve this file ,it will replace all the <xi:include href> element with the actual xml fragments one by one.

Step 4: After replacing all <xi:include> ,XIncludeConverter will store the new xml string into string variable named “convertedXmlString”.

Step 5: The XMLManipulator read the convertedXmlString ,and remove all the user configuration part from such as  <add_elements>,<update_elements>,<remove_elements> ,since these information is used for letting test case end user configure how to operate the base data to meet special requirements,so these part shouldn’t exist in final data.

Step 6:After removing all config elements ,The XMLManipulator store the xml string into a new string variable named “ removeAllConfXmlString”

Step 7:Since the configuration information are removed in Step 5-6 ,but they still exist in original xml string ,so XMLModifyInfoExtractor read all the <add_elements>,<update_elements>,<remove_elements> part from original xml string ,and smartly match which corresponding testcase data it will operate .

Step 8:After analyzing all the user modification requirement ,the XMLModifyInfoExtractor store these modification info into 3 arraylists , addElementInfoList,updateElementInfoList,removeElementInfoList.

Step 9:Now it is time to begin modifying the xml ,so the XMLManipulator read the “removeAllConfXmlString”  in Step 6 .

Step 10:Then  XMLManipulator  use all the modification info in Step 8 ,and do modification operation one by one : addElementToXML() ,updateElementFromXML(),removeElementFromXML()

Step 11: after finish all the modification ,XMLManipulator store the final xml string into string variable named “modifiedXmlString”

Step 12: Finally it convert the xml formatted string to a jsonobject and it now can be used as a data provider which can be consumed in each test case.






本文转自 charles_wang888 51CTO博客,原文链接:http://blog.51cto.com/supercharles888/1221708,如需转载请自行联系原作者
目录
相关文章
|
3月前
|
前端开发 测试技术 API
测试金字塔:别再只盯着UI自动化了
测试金字塔:别再只盯着UI自动化了
460 116
|
3月前
|
敏捷开发 测试技术 API
测试金字塔:构建高效自动化测试策略的基石
测试金字塔:构建高效自动化测试策略的基石
355 116
|
3月前
|
人工智能 自然语言处理 测试技术
从人工到AI驱动:天猫测试全流程自动化变革实践
天猫技术质量团队探索AI在测试全流程的落地应用,覆盖需求解析、用例生成、数据构造、执行验证等核心环节。通过AI+自然语言驱动,实现测试自动化、可溯化与可管理化,在用例生成、数据构造和执行校验中显著提效,推动测试体系从人工迈向AI全流程自动化,提升效率40%以上,用例覆盖超70%,并构建行业级知识资产沉淀平台。
从人工到AI驱动:天猫测试全流程自动化变革实践
|
3月前
|
人工智能 自然语言处理 JavaScript
利用MCP Server革新软件测试:更智能、更高效的自动化
MCP Server革新软件测试:通过标准化协议让AI实时感知页面结构,实现自然语言驱动、自适应维护的自动化测试,大幅提升效率,降低脚本开发与维护成本,推动测试左移与持续测试落地。
|
3月前
|
测试技术 API 数据库
测试金字塔:构建高效自动化测试策略的基石
测试金字塔:构建高效自动化测试策略的基石
383 114
|
4月前
|
人工智能 测试技术 项目管理
测试不再碎片化:AI智能体平台「项目资料套件」功能上线!
在实际项目中,需求文档分散、整理费时、测试遗漏等问题常困扰测试工作。霍格沃兹推出AI智能体测试平台全新功能——项目资料套件,可将多个关联文档打包管理,并一键生成测试用例,提升测试完整性与效率。支持套件创建、文档关联、编辑删除及用例生成,适用于复杂项目、版本迭代等场景,助力实现智能化测试协作,让测试更高效、更专业。
|
5月前
|
存储 人工智能 算法
AI测试平台实战:深入解析自动化评分和多模型对比评测
在AI技术迅猛发展的今天,测试工程师面临着如何高效评估大模型性能的全新挑战。本文将深入探讨AI测试平台中自动化评分与多模型对比评测的关键技术与实践方法,为测试工程师提供可落地的解决方案。
|
6月前
|
消息中间件 监控 前端开发
如何开发项目管理系统中的项目结项板块?(附架构图+流程图+代码参考)
在企业项目管理中,“项目结项”是关键环节,常因流程不清、文档不全、审批滞后等问题导致交付困难。本文介绍如何通过“项目结项”模块实现线上化管理,涵盖结项申请、审批流程、成果上传、权限控制等功能,帮助团队高效完成项目收尾,避免成果丢失与流程混乱。内容包括功能设计、业务流程、系统架构、数据库设计、核心代码实现、前端交互及优化建议,助力项目管理系统快速落地并稳定运行。
|
6月前
|
JSON JavaScript 测试技术
用Postman玩转电商API:一键测试+自动化请求教程
Postman 是电商 API 测试的高效工具,涵盖基础配置、自动化测试、环境管理与请求自动化,助你快速提升开发效率。
|
4月前
|
测试技术 UED 开发者
性能测试报告-用于项目的性能验证、性能调优、发现性能缺陷等应用场景
性能测试报告用于评估系统性能、稳定性和安全性,涵盖测试环境、方法、指标分析及缺陷优化建议,是保障软件质量与用户体验的关键文档。