Forum Discussion
Nastya_Khovrina
SmartBear Alumni (Retired)
Hi 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.
saimie
7 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_Khovrina7 years agoSmartBear Alumni (Retired)
There is the corresponding KB article: How to get cookies in Groovy scripts?
Related Content
- 10 years ago
- 6 years ago
- 9 years ago
Recent Discussions
- 22 days ago