JMeter - running different queries at each iteration

I am currently using JMeter to simulate 5 users running queries every 40 seconds. I created 100 different queries, but every 40 seconds every user launches all 100 queries. I want to do this in such a way that every 40 seconds each user runs only one request, and this request should be different from the previous request. I would like to know which controller to use (or something else) to achieve this scenario.

thanks

+7
source share
2 answers

Try using a random controller .

The easiest way to implement your scenario:

  Thread group
 Number of Threads = 5
 Loop count = n
     .  .  .
     Random controller
         HTTP Request 001
         HTTP Request 002
         HTTP Request 003
         .  .  .
         .  .  .
         HTTP Request 100
     Test action
     Target = current thread
     Action = Pause
     Duration = 40,000
     .  .  .

This will iterate 5 threads N times.
The random controller will randomly pick up an http request from the "request pool" at each step - all the samplers added as children to the random controller.
The test will pause the stream for 40 seconds.

Updated:
working drawing for the diagram above:

Random Controller example

  Thread group
 Number of Threads = 5
 Ramp-Up Period = 0
 Loop count = 10

 Constant timer
 Thread Delay (in ms) = 40,000

You can download a working example for the described scheme here: rc-plan.jmx .
This works as you like (at least for me, Jmeter 2.5.1): it selects a random ONE request from the request pool (in the example - 10 requests) for EVERY user (here 5 users) at EVERY step (here 10 cycles) and pauses each thread for 40 seconds (constant timer).

You can also look at this mail archive: Is this a way of randomizing URL choices? . A situation similar to yours seems to be described here .

... According to the official documentation, "Interaction between multiple controllers can lead to complex behavior. This is especially true for a random controller."

+13
source

Another option would be to create a CSV file with parameters for your requests ahead of time and use the CSV Data Set Config to parameterize a single HTTP request.

It obviously depends on how different your HTTP requests are, but if they meet your requirements, there are some potential bonuses with support for 1 HTTP request in your test plan versus 100.

Other details will be the same as the output by @Alies Belik - one thread group configured for your desired number of threads and loops, with a constant timer at the end for your 40 second pause.

+6
source

All Articles