Forum Discussion
rakesh133
8 years agoOccasional Contributor
Hi All,
Finally, I found a workaround for this issue. I passed the Json response to "def json = JsonOutput.toJson(response)" based on this stackoverflow question. Now the response is successfully parsed evenif the special characters are present
The Groovy code will be something like this.
import groovy.json.*
def responseContent = testRunner.testCase.getTestStepByName("Name of the Test Step").getPropertyValue("response")
def json = JsonOutput.toJson(responseContent)
def result = new JsonSlurper().parseText(json)
log.info resultLets see how it goes and I will update you.