Forum Discussion

NarasimhaRaoSL's avatar
NarasimhaRaoSL
New Contributor
7 years ago

Retrieving a cookie from response header using Groovy

Could you help me how to retrieve a cookie from response header using Groovy?
  • bagochips's avatar
    7 years ago

    Try something like this 

     

    def cookie_name = testRunner.testCase.testSteps["Request_Step_Name"].testRequest.response.responseHeaders["Cookie-Name"]

    log.info cookie_name

     

    // Change Cookie-Name to whatever the name of the header name you are looking for