Last active
August 29, 2015 14:07
-
-
Save anandsunderraman/5c170c03f78753517a32 to your computer and use it in GitHub Desktop.
soap ui groovy parse json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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