2

Not able to pass Response Header (Set-Cookie value) to another request Body in order to place a reservation.

To place a reservation i need to get HoldReservation cookie from Reservedate API but when getting all cookies in Beanshell postprosessor and sending it to Beanshell preprosessor is not helping.

I have Cookie Manager at Thread level but that is not getting this cookie that is generated in the middle of the execution.

I want to get just the HoldReservation and expires from the below Cookie: Set-Cookie: HoldReservation=; expires=Thu, 15-Apr-2021 17:40:20 GMT; path=/; secure

1 Answer 1

1

The easiest way is just adding the next line to the user.properties file:

CookieManager.save.cookies=true 

and on next JMeter restart you will be able to access the cookie as `${COOKIE_HoldReservation} where required. More information: HTTP Cookie Manager Advanced Usage - A Guide

If you still want to do this using regular expressions here is an example setup:

enter image description here

textual representation of the regular expression:

Set-Cookie:\s*HoldReservation=(.+?); 
1
  • I tried both ways and one with regex is showing up in request headers(HTTP format) with HoldReservation and Expiry details but it doesn't show in cookies(Raw format) and the request still failing to get the response. Could you please tell me how to show HoldReservation in Cookies Commented Apr 19, 2021 at 16:19

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.