Forum Discussion
Nastya_Khovrina
Alumni
8 years agoHi Ravi,
Thank you for your post. You should get all cookies in the Response editor if they were received.
BTW, here is the script to get all response headers:
def headers = testRunner.testCase.testSteps["Test_Step_Name"].testRequest.response.getResponseHeaders() log.info(headers)
and specific response headers (for example, Set-Cookie):
def headerValue = testRunner.testCase.testSteps["Test_Step_Name"].testRequest.response.responseHeader["Set-Cookie"] log.info(headerValue)
You can use the mentioned scripts in the Groovy Test Step.
- saimie8 years agoNew Contributor
Hi - the script below is incorrect. You will need to run the following script for specific response headers:
def headerValue = testRunner.testCase.testSteps["Test_Step_Name"].testRequest.response.responseHeaders["Set-Cookie"] log.info(headerValue)
Thanks,
Sam
- Nastya_Khovrina8 years ago
Alumni
There is the corresponding KB article: How to get cookies in Groovy scripts?