Reputation: 21
I need to get JSESSIONID from cookie data in jmeter but I am failing in doing so.
Process I am following -
In my .jmx file I have added regular expression extractor as:
- Reference Name - session_id
- Regular Expression - Cookie Data\s*:\sCMS_JSESSIONID=([^;])
- Template - $1$
- Match - 0
- Default Value - Not found
This I have added under my second url request. I am trying to extract JSESSION id from "Request" page which comes under View Results tree:
Cookie Data: CMS_JSESSIONID=8456329D51C6D7F3B924325A336CA31E
And for checking I have added debug sampler but every time result is showing "Not found".
Kindly please help.
Thanks,
Nitish
Upvotes: 1
Views: 11006
Reputation: 168197
According to Wikipedia cookies are coming with Set-Cookie
header so you need to amend your Regular Expression Extractor like:
Response Headers
Set-Cookie\s*:\sCMS_JSESSIONID=([^;])
However there is an easier way to get the cookie value (steps 1 and 2 required only once)
CookieManager.save.cookies=true
line to user.properties file ${COOKIE_CMS_JSESSIONID}
where required. Upvotes: 10