cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass the dynamic response from 1st request to 2nd request ?

Super Contributor

How to pass the dynamic response from 1st request to 2nd request ?

I have first request (Request 1), from which I can get any number of responses, lets say response 1, response 2 , response 3 etc.

And after that I will be passing this response separated with comma inside another request (Request 2).

 

How can we do it using groovy code.

1 REPLY 1
Highlighted

Thank you for posting to our Community Forum.

 

In a groovy script TestStep you can grab the response data from a Request TestStep using the "Get Data" menu.

https://support.smartbear.com/readyapi/docs/testing/properties/get-data.html

 

Then you can parse/modify the response as needed and pass it into a TestCase property through the following line:

context.testCase.setPropertyValue("Property Name","Property Value");

 

Subsequent TestSteps can now get that value by navigating to it in the Get Data menu.

 

Have a great day!

Best,
Steven
Atlassian Ecosystem Manager
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors