I have one http request and it extracted the csrf token.But the csrf token attached with attached with html and javascript.

  1. If the request success the csrf token is attached with HTMl.
  2. If the request fails the csrf is attached with javaScript. I'm able to extract both and i need to pass the csrf to next request. based on the condition. How can i achieve it ?Any suggestions.

Test Plan

1 Answer 1


Just use the same "Name of created variable" in both post processors, the one which matches will get the value.

For future reference:

  1. You can conditionally execute JMeter Samplers by putting them under If Controller
  2. You can check whether JMeter Variable is defined or not using __isVarDefined() function, if your extractor fails - the variable will not be defined.

Your Answer

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

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