2
votes

Can we add a user thread after the previous thread has completed its request in Jmeter?

I have a 10 users, want to add the 2nd user after the 1st user has received a response? i.e first users page take 400ms to load, my second user should be added after 400ms. Similarly for 3rd user depending on the 2nd users load time?

Hope this is clear !

1

1 Answers

1
votes

A bit tricky case, but it achievable with Inter-Thread Communication Plugins.

You should create test plan like this:

TestPlan
  - Thread Group
    - Sampler
      - Communication PreProcessor
      - Communication PostProcessor

At the TestPlan level you should use __fifoPut function to put initial value into FIFO.

This will work like this: before sampler started, the PreProcessor is called. All 100 threads will block and wait for FIFO to have some value in it. Only one of threads will start its work, because __fifoPut function added only one value into FIFO. After the Sampler finished its request the PostProcessor will be called and it will put another value into FIFO. This will unblock one more thread. And so on.

The order in which threads are unblocked is random. If you need strict sequence, you may use FIFO queue names that chaining threads sequence by its number.