I'm automating REST API's using SOAPUI. I've 2 different resources and below are the Response JSON formats. The root element varies but the status block remains same for both the response jsons. After the Rest API POST call, I've a Groovy script in place to validate the response (if "code" == "00")
Goal: Using Groovy Script, I've to Parse through the JSON and retreive the "code" node value irrespective of the root element.
Response(JSON) Formats:
{
"resouurce_1_response":
{
"status":
{
"code": "00"
}
}
}
{
"resource_2_response":
{
"status":
{
"code": "00"
}
}
}