[SoapUI] 比较两个不同环境下XML格式的Response, 结果不同时设置Test Step的执行状态为失败
2024-10-20 16:02:01
import org.custommonkey.xmlunit.*
def responseTP=context.expand( '${Intraday Table_TP#Response}' )
def responseLive=context.expand( '${Intraday Table_Live#Response}' ) if (responseTP == responseLive)
{
log.info "Test case pass"
assert true
}
else{
log.info "Test case failed" def xmlDiff = new Diff(responseTP, responseLive)
assert xmlDiff.identical()
}
或者简洁一点,直接去比较就好了
import org.custommonkey.xmlunit.*
def responseTP=context.expand( '${Intraday Table_TP#Response}' )
def responseLive=context.expand( '${Intraday Table_Live#Response}' ) def xmlDiff = new Diff(responseTP, responseLive)
assert xmlDiff.identical()
最新文章
- 在wex5平台grid显示问题
- hadoop(2014/0619)
- 【仿真】Lattice_Diamond_调用Modelsim_仿真
- EditTextPreference点击后输入框显示隐藏内容,类似密码输入(转)
- jsonObject jsonArray jsonTokener jsonStringer,json解析以及http请求获取josn数据并加以解析
- linux创建交换分区
- Fedora下YouCompleteMe配置
- grub引导centos
- 基于Verilog HDL的ADC0809CCN数据采样
- [error]error while loading shared libraries: libpcre.so.1 解决
- mange
- Luogu 3758 [TJOI2017]可乐(有向图邻接矩阵幂的意义 矩阵快速幂)
- pg安装入门
- leetcode96
- 【kuangbin专题】计算几何_凸包
- 【AtCoder】ARC091
- MVC输出字符串常用四个方式
- win10 操作配置备忘
- android:json解析的两个工具:Gson和Jackson的使用小样例
- Teaching Machines to Understand Us 让机器理解我们 之三 自然语言学习及深度学习的信仰