[SoapUI]简单实例,jdbc request比对接口返回值

import com.eviware.soapui.support.GroovyUtils
import com.eviware.soapui.support.JsonUtil

//动态获取数据库值
def responsexml=context.expand('${check_tn_recency#ResponseAsXml}')
def xmlParser=new XmlParser().parseText(responsexml)
def tn_recency=xmlParser.ResultSet[0].Row[0].TN_RECENCY.text().toDouble()

//接口返回值
def tenant_recency=context.expand( '${memberKPI#Response#$.tenant_recency}' ).toDouble()

//断言
assert tn_recency==tenant_recency

你可能感兴趣的:(SoapUI)