I made a Jmeter script like one thread in it login then my transaction and logout. I have put login n only once controller and transaction in loop controller. But when I execute concurrent thread some threads are failing as csrf token is not matching sequentially. I extract csrf token using regular expression. For 1-2 users it is working fine but more threads it is failing.
1 Answer
Try adding some debug logging to your test, i.e.
- Save CSRF Token value into .jtl results file using Sample Variables property
Save all the responses into the .jtl results file, you can do this by adding the next lines to user.properties file:
jmeter.save.saveservice.output_format=xml jmeter.save.saveservice.response_data=true jmeter.save.saveservice.response_data.on_error=true- Inspect the response and the CSRF Token variable value using Debug Sampler and View Results Tree listener combination - it should be 100% match for each virtual user and different threads (virtual users) must have different CSRF Token values.