码迷,mamicode.com
首页 > Web开发 > 详细

[SoapUI] 在SoapUI script里获取Response(Json格式)某个节点值

时间:2017-02-11 16:56:00      阅读:1031      评论:0      收藏:0      [点我收藏+]

标签:节点   info   rip   jpa   ref   values   获取   class   nbsp   

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

 

[SoapUI] 在SoapUI script里获取Response(Json格式)某个节点值

标签:节点   info   rip   jpa   ref   values   获取   class   nbsp   

原文地址:http://www.cnblogs.com/wynlfd/p/6389305.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!