0

The response that I'm getting in JMeter vs Browser's Network tab response doesn't match. There's a CSRF token but it's not placed on a hidden input tag it's inside a JS var and is being returned when page is accessed.

I'm using a Regular Expression Extractor but I'm not sure if I get the correct CSRF value

So the script looks like this:

<script type="text/javascript">
    var csrf_token = "CSRFTokenHere"

And my Regular Expression Extractor looks like this:

window.csrf_token              = '(.+?)';
1

You should use something like:

var csrf_token = "(.+?)"

Demo:

JMeter Regular Expression Demo

Useful materials:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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