How to extract the parameter from Json Response Using Groovy?

后端 未结 1 1333
伪装坚强ぢ
伪装坚强ぢ 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)
提交回复
热议问题