How to extract the parameter from Json Response Using Groovy?

后端 未结 1 1318
伪装坚强ぢ
伪装坚强ぢ 2020-12-30 11:24

The below is my response..

{\"activation\":{\"existing\":false, \"customer\": new}}

Now when I use

testRunner.testCase.get         


        
相关标签:
1条回答
  • 2020-12-30 11:52
    import groovy.json.JsonSlurper
    
    responseContent = testRunner.testCase.getTestStepByName("xxx").getPropertyValue("response")
    slurperresponse = new JsonSlurper().parseText(responseContent)
    log.info (slurperresponse.activation.customer)
    
    0 讨论(0)
提交回复
热议问题