Reputation: 578
I have recorded script and run jmeter. the Session id and Xsrf tokens are passing request header cookies in browser cookies. but,session id is not passing in jmeter. So, connection closed error occurring.
How can i extract session id and xsrf token using regular expression extractor?
Upvotes: 0
Views: 2518
Reputation: 11
You can use XPath extractor and enter "//input[@name='_csrf']/@value" to get the csrf token value and then enter desired reference name for example "csrf_token" and use the variable ${csrf_token} wherever necessary
Upvotes: 0
Reputation: 168147
Add the next line to user.properties file (located in the "bin" folder of your JMeter installation)
CookieManager.save.cookies=true
Now you should be able to refer cookie values as:
${COOKIE_session}
and ${COOKIE__xsrf}
where requiredMore information: Using the HTTP Cookie Manager in JMeter
Upvotes: 1