I want to set user defined cookies value i.e. ai_user & ai_session dynamically for each user in "HTTP CookiesManager" in JMeter, as it happens in browser ecommerce website. It's hard code for now but I want it's value dynamic & unique for each incoming user.

1

There are 1 best solutions below

0
Dmitri T On

It's sufficient to add a HTTP Cookie Manager to your test plan and it will automatically handle incoming cookies

If it doesn't - most probably something is wrong with the application you're testing, i.e. it responds with invalid or expired cookies. If this is the case you can consider changing the "Implementation" to something less-restrictive

enter image description here

and/or add the next line to user.properties file:

CookieManager.check.cookies=false

More information: HTTP Cookie Manager Advanced Usage - A Guide

Also it's always possible to handle the cookies manually by extracting them from Set-Cookie response header using Regular Expression Extractor and add them to resulting JMeter Variables to HTTP Cookie Manager (or HTTP Header Manager)