Forum Discussion

KSN's avatar
KSN
New Contributor
7 years ago
Solved

How to get the property from Json response using Groovy in soapui

Hi ,   Below is the json response, from this i need to get the uri based on the name, here name=abc. Using json.url[0].services[0].config.www[0].uri, i got the desired value but heard that its not...
  • JHunt's avatar
    7 years ago

    I would do something like this...

     

    new groovy.json.JsonSlurper().parseText(json)
     .url.find { it.name == 'test' }
     .services.find { it.name == 'abc' }
     .config.www.uri