0
votes

I have a Login transaction where in this there are 10 requests. I have added a Uniform random timer for Login transaction for 2 to 3 seconds. i.e all these 10 request will wait for 3 seconds before sending the request as below.

  1. wait for 3 seconds sends Request1
  2. wait for 3 seconds sends Request2
  3. wait for 3 seconds sends Request3 and so on.

So my question is does Jmeter waits for the response before sending the next request. i.e will Request2 waits for the response or will Request3 is sent after 3 seconds irrespective previous requests response. in this case Request2's response.

Please help in this.

Thanks in Advance,

1
Timers are processed before each sampler in the scope in which they are found; if there are several timers in the same scope, all the timers will be processed before each sampler. And the timer doesn't wait for the response as it is processed before the sampler execution. A timer works only to trigger the request sampler.Adnan
As per JMeter documentation: To apply a timer to a single sampler, add the timer as a child element of the sampler. The timer will be applied before the sampler is executed. To apply a timer after a sampler, either add it to the next sampler, or add it as the child of a Test Action Sampler.Adnan

1 Answers

0
votes

JMeter will wait for response from previous request prior to sending next request in any case. In normal conditions it would look like:

  • Request 1
  • Request 2
  • Request 3
  • ...

See A Comprehensive Guide to Using JMeter Timers article for more information on how Timers work.

By adding a Timer you create a "sleep" before each request, it will look like:

  • Sleep 2 - 3 seconds
  • Request 1
  • Sleep 2 - 3 seconds
  • Request 2
  • Sleep 2 - 3 seconds
  • Request 3
  • ...

However as per documentation:

Each thread will execute the test plan in its entirety and completely independently of other test threads. Multiple threads are used to simulate concurrent connections to your server application.

So if you have > 1 thread you may run into the situation when different threads are executing requests at the same time (which is the main point of load testing).