2

I want to create JMeter script in which some API calls are made only after the response to the API calls which it is dependent upon is received successfully. Is it possible in JMeter? And if yes then please let me know how?

1
  1. To determine whether previous sampler was successful or not you can use If Controller and the following condition:

    ${JMeterThread.last_sample_ok}
    

    Something like:

    • Request 1
    • If Controller with the above condition
      • Request 2
    • Request 3

    Assuming the above configuration Request 2 will be executed only if Request 1 is successful. Request 3 will be executed always

  2. In regards to adding a delay between requests there are 2 ways:

    • Test Action sampler in Pause mode. It doesn't generate sample result and you can use it for pausing thread(s) between request
    • JMeter provides variety of Timers. Timers respect scoping rules and produce delay before sampler(s) in scope is(are) executed.

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.