【发布时间】:2013-05-16 10:31:18
【问题描述】:
以下是我的回答..
{"activation":{"existing":false, "customer": new}}
现在当我使用
testRunner.testCase.getTestStepByName("xxx").getPropertyValue("response")
以上脚本正在提取响应。现在我想提取"customer" 值。
如何做到这一点?
谢谢
【问题讨论】:
标签: soapui
以下是我的回答..
{"activation":{"existing":false, "customer": new}}
现在当我使用
testRunner.testCase.getTestStepByName("xxx").getPropertyValue("response")
以上脚本正在提取响应。现在我想提取"customer" 值。
如何做到这一点?
谢谢
【问题讨论】:
标签: soapui
import groovy.json.JsonSlurper
responseContent = testRunner.testCase.getTestStepByName("xxx").getPropertyValue("response")
slurperresponse = new JsonSlurper().parseText(responseContent)
log.info (slurperresponse.activation.customer)
【讨论】:
activation.customer 作为动态值传递,因为这些值会随着不同的 json 响应而变化。