关于项目自动化测试架构的改良计划-去除动作指令
因为我们在test_suite.xml中定义了多个动作指令,比如

网站建设哪家好,找创新互联建站!专注于网页设计、网站建设、微信开发、微信小程序定制开发、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了依安免费建站欢迎大家使用!
public class XMLManipulator {
public static String removeModifyConfFromXML(String xmlString) throws Exception{
Document doc = null;
doc = DocumentHelper.parseText(xmlString);
//remove the from the target xml
List addPart = doc.selectNodes("/test_suite/test_case/add_elements");
for(Node node: addPart){
node.getParent().remove(node);
}
//remove the from the target xml
List updatePart = doc.selectNodes("/test_suite/test_case/update_elements");
for(Node node: updatePart){
node.getParent().remove(node);
}
//remove the from the target xml
List removePart = doc.selectNodes("/test_suite/test_case/remove_elements");
for(Node node: removePart){
node.getParent().remove(node);
}
//find document again
return doc.asXML();
}
..
} 这样最终的xml文件就不包含这些动作指令的代码片段了。
标题名称:关于项目自动化测试架构的改良计划-去除动作指令
文章分享:http://www.jxjierui.cn/article/jsiohh.html


咨询
建站咨询
