davissoap
9 years agoOccasional Contributor
Unable to retieve Cookie value
I am testing a rest service which generates a cookie .I am using the following in my assertion
if (messageExchange.responseHeaders.containsKey('Set-Cookie')) {
log.info "Found Cookie in the response headers"
def cookiez = messageExchange.responseHeaders['Set-Cookie'].value
cookiez.each { cookies ->
log.info cookies.toString()
}
} else {
log.warn "Not Found Cookie in the response headers"
}
it always print Not Found Cookie in the response headers in the log as it doesn't find the coookie.I can see the cookie and its value in http log.is there any configuration i need to do .Any help would be very welcome.