My app returns two Set-Cookie headers: JSESSIONID and AWSELB.
When I write test in Postman and use postman.getResponseHeader("Set-Cookie")
it only returns AWSELB.
Any idea how can I get JSESSIONID?
EDIT: Accepted Answer solved it in one way, now I have same issue but with sending two headers with same key. I should be able to send multiple 'Set-Cookie' headers, but when I do that it looks like only the last one is being sent, first one is overridden.
It seems that getResponseHeader contains only the last header, so it is not really useful when dealing with cookies.
I would rather suggest you try
getResponseCookie
For example:
tests["Should contain JSESSIONID cookie"] = postman.getResponseCookie('JSESSIONID').value === 'abcdef';
Hope this helps!