Home > Blockchain >  How to implement recursion in JMeter?
How to implement recursion in JMeter?

Time:02-18

I'm trying to create performance test for ASYNC API calls. Steps:

  1. Send HTTP POST request. In response I'm getting just session ID.
  2. Send JDBC request query to get URL for JSON response (step. 1) from DB.
  3. Send HTTP GET request (URL from step. 2) to assert response result.

Problem: Step 2 takes some time (3-5 seconds) to generate URL in DB. I used hard delay (Constant Timer), but it is not a good way, especially for measure performance. In my test framework I solve this with recursion. Is there any way to implement recurring requests until condition not met in JMeter?

CodePudding user response:

The easiest is going for While Controller, you can put the JDBC Request sampler under the While Controller and it will be executed in loop until the condition you specify is true

More information: Using the While Controller in JMeter

  • Related