0

I'm using BlazeMeter recording tool and running it on JMeter, but in my response data I'm getting CSRF token validation failed when I try to test my web application's login page.

enter image description here

enter image description here

1
  • Possible issue is, you are passing that token hard coded. you need to extract the new token every time comes in GET request and store into some variable and then have to pass that variable to POST request as @Dmitri T mentioned.
    – NarendraR
    May 14, 2018 at 11:31

1 Answer 1

2

You need to consider a different structure of your test to make it behave like a real browser:

  • Open Login Page (HTTP Get Request)
    • Extract _csrf_token value from the response and save it into a JMeter Variable
  • Perform Login (HTTP Post request). At this stage you need to provide credentials and _csrf_token from the previous request.

See How to Load Test CSRF-Protected Web Site article for more information with regards to bypassing CSRF protection in JMeter tests.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.