[SoapUI] 在SoapUI Rest请求Assertion里获取Response(xml格式)某个节点值

Posted Sunshine168

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[SoapUI] 在SoapUI Rest请求Assertion里获取Response(xml格式)某个节点值相关的知识,希望对你有一定的参考价值。

import com.eviware.soapui.support.GroovyUtils
import com.eviware.soapui.support.JsonUtil
import com.jayway.jsonpath.*
import java.lang.String

def response = context.expand(‘${ResponseAsXml}‘)  //Get Response
def xmlParser = new XmlParser().parseText(response)  // use xmlParser to control response 
String effectiveDate = xmlParser.ResultSet[0].Row[0].EFFECTIVEDATE.text() // XPath
log.info effectiveDate

 

以上是关于[SoapUI] 在SoapUI Rest请求Assertion里获取Response(xml格式)某个节点值的主要内容,如果未能解决你的问题,请参考以下文章