Skip to content

Instantly share code, notes, and snippets.

@anandsunderraman
Last active August 29, 2015 14:07
Show Gist options
  • Save anandsunderraman/5c170c03f78753517a32 to your computer and use it in GitHub Desktop.
Save anandsunderraman/5c170c03f78753517a32 to your computer and use it in GitHub Desktop.
soap ui groovy parse json
//import library to parse JSON
import groovy.json.JsonSlurper;
//get the JSON response from the test step that makes the call to some test step to get a JSON repsonse
def response = testRunner.testCase.getTestStepByName("TestStepName").getPropertyValue("response");
//parse the json response
def responseJSON = new JsonSlurper().parseText(response);
//access the propertyname
def property = responseJSON.propertyname;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment