Search code examples
httprequestjmetertoken

How to make sure that lastrequest is successful and proceed to next


Scenario is: SIGNUP, which will be used further for login and other scenarios.

Check if last request is successful and get Token to proceed further with login and purchase?


Solution

  • You can use If Controller with the following condition:

    ${JMeterThread.last_sample_ok}
    

    Put the Sampler(s) you would like to be executed conditionally as the If Controller's child(ren) and they will be executed only if the condition is met.

    JMeter If Controller Last Sampler OK

    Where ${JMeterThread.last_sample_ok} is a pre-defined JMeter variable holding the result of previous sampler execution, it is true if previous sampler was successful and false otherwise.