网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

关于项目自动化测试架构的改良计划-去除动作指令

因为我们在test_suite.xml中定义了多个动作指令,比如,等,他们指示让我们Engine来对最终数据进行操作,这些动作指令不是数据,因此,他们并不包含在我们最终的数据结果集中,所以我们必须对他们进行移除。所以我们用以下代码来进行移除工作:

网站建设哪家好,找创新互联建站!专注于网页设计、网站建设、微信开发、微信小程序定制开发、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了依安免费建站欢迎大家使用!

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文件就不包含这些动作指令的代码片段了。


新闻名称:关于项目自动化测试架构的改良计划-去除动作指令
网页URL:http://bjjierui.cn/article/jsiohh.html

其他资讯