skyhigh
8 years agoContributor
How to parse JSON or XML in Assertions
Hi All, I'm trying to parse each response value from a response format either XML or JSON. I found some posts and tried them, but couldn't get it work because I always get errors. Can someone s...
- 8 years ago
Assuming that the JSON data is valid
//iterate
def int count = 0;
parsedJson.Data.each
{
log.info parsedJson.Data[count].MemberName
count++;
} - 8 years ago
Here is the script assertion for json.
https://github.com/nmrao/soapUIGroovyScripts/blob/master/groovy/json/JsonArraySample.groovy
You can also try the online demo for the same:
https://ideone.com/Z3wyfh