Each time I execute home page of ecommerce website, some cookies appear in request header some of them have unique values each time we hit Home request which is ai_user & ai_session. I want to know how do I get those unique values in JMeter for each time I hit home request. I recorded test script by blaze meter and it automatically recorded all cookies in HTTP CookieManager as a user defined cookies but those values are hard coded I want them dynamic as it works in browser. I already Change the property CookieManager.save.cookies=true in jmeter properties file.Jmeter.properties file is located in JMeter’s bin folder and use variable ${COOKIE_ai_user} in script to use cookie value. But issue is its value is static I want to make it dynamic, how can I do that?
Asked
Active
Viewed 188 times
1 Answers
0
Each time I execute home page of ecommerce website, some cookies appear in request header
No, it doesn't work that way.
- When you open the page first time the browser gets cookies from Set-Cookie header
- When you open the page next time the browser sends cookies as Cookie header
So the situation when you're sending cookies at the very first request is highly unlikely to happen (unless you're simulating a returning user)
It's sufficient to add HTTP Cookie Manager which simulates browser's cookie storage and automatically handles incoming cookies.

Dmitri T
- 159,985
- 5
- 83
- 133
-
Yes its working this way 1) When you open the page first time the browser gets cookies from Set-Cookie header 2) When you open the page next time the browser sends cookies as Cookie header But set-Cookies only show "Set-Cookie: d365mkt=PK; expires=Wed, 02-Mar-2022 08:55:36 GMT; path=/; secure; HttpOnly" in response header of 1st request, it don't show other cookies like ai_user & ai_session, how di I get those values? – Areeba Rafi Mar 02 '22 at 08:08