[SoapUI] 在SoapUI script里獲取Response(Json格式)某個節點值


import com.eviware.soapui.support.GroovyUtils
import com.eviware.soapui.support.JsonUtil
import com.jayway.jsonpath.*
import com.eviware.soapui.support.XmlHolder

String responseAPI = context.expand('${GetFundSizeValueScoreFromAPI#Response}')  //get response
def data = JsonPath.read(responseAPI,'$.data[0].effectiveDate')  // get data by Jpath
log.info data

or
def data = JsonPath.read(responseAPI,'$.data')
String effectiveDate = data.get(0).get("effectiveDate")
log.info effectiveDate

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM