Forum Discussion

avidCoder's avatar
avidCoder
Super Contributor
7 years ago

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

  • StevenColon's avatar
    StevenColon
    SmartBear Alumni (Retired)

    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!