首页 > 代码库 > [SoapUI] 在SoapUI Rest请求Assertion里获取Response(xml格式)某个节点值

[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格式)某个节点值