Forum Discussion

saradhipb's avatar
saradhipb
Occasional Contributor
10 years ago

How to validate response using script assertion when the Rest Response has multiple nodes?

Trying to perform an End to End Test using readyapi/soap ui pro, if any solution please advise..

  • I have rest URI as http:localhost/DataRequest1/DataRequest2/DataRequest3. All the Data request I have created as a Template.
  • I created a test step 'Data Source' & 'Data Source Loop' and passed data.
TestCaseStatusDataRequest1DataRequest2DataRequest3Response1Response2
 A001B001C001D001E001
 A002B002C002D002E002
 A001B001C001D003E003
 A002B002C002D004E004
 A001B001C001D005E005
 A002B002C002D006E006
  • In response I have getting response in below JSON if I perform 1st Step as Rest request

Reuest URI: http:localhost/A001/B001/C001.

Response JSON:

[
{

"DataRequest1": "A001",
"DataRequest2": "B001",
"DataRequest3": "C001",
"Response1": "D001",
"Response2": "E001"
},
{

"DataRequest1": "A001",
"DataRequest2": "B001",
"DataRequest3": "C001",
"Response1": "D003",
"Response2": "E003"
},
{

"DataRequest1": "A001",
"DataRequest2": "B001",
"DataRequest3": "C001",
"Response1": "D005",
"Response2": "E005"
}
]

 

As you see on the above I get multiple responses on a request. My challenge is to validate whether I am getting the response correctly or not in form of Script Assertion and store it as a TestCaseStatus for each iteration from the Data Source Step and validate the response with property response on Data Source Step.

 

Any suggestions please?

7 Replies