Reputation: 5006
I'm testing a site in jMeter 5.1 that once returns a header "X-Csrf-Token" and expects the value to be found in a cookie named __csrf_token-1.
The HTTP Cookie manager alone is no help, as I need to write a response header (not a recieved cookie) into a cookie.
How can change cookie values on the fly?
Thanks!
Upvotes: 0
Views: 1342
Reputation: 168002
Extract the cookie from the previous response using i.e. Regular Expression Extractor configured like:
double check that the extraction succeeds using Debug Sampler and View Results Tree listener combination
Add HTTP Cookie Manager as a child of the next request and configure it to send __csrf_token-1
cookie with the value of ${token}
make sure to provide correct Domain
and Path
values, if you don't know them - change "Cookie Policy" to netscape
Upvotes: 1