Forum Discussion

rajs2020's avatar
Frequent Contributor
4 years ago

ReadyAPI - How to access the entire request and response from a Groovy script?

Inside a groovy test step, is it possible to access the entire request and response data from a previous REST API test step? If yes, then how do we access the request and response?

  • rajs2020 : Yes it is possible to get the request and response of any test step refer below code sample:


    def request = testRunner.testCase.getTestStepByName("TEST__STEP__NAME").getPropertyValue("Request")
    def response = testRunner.testCase.getTestStepByName("TEST__STEP__NAME").getPropertyValue("Response") request response

    Let me know in case more help you needed.


3 Replies