How to implement Think Time in Jmeter

What is Think Time?

In load testing, “think time” stands for simulating real user behavior which causes people to wait between interactions with a web application.It is time delay between user actions or business steps.Real-life users don’t hammer a web application non-stop; they need some time to consume the returned content, plus some time to “think” about their next action and this “think time” needs to be accurately simulated as well. It’s important to remember that the whole idea of the load test is simulating real user’s behavior as close as possible.Think times may vary from application to application.

We know that jmeter timers are used for this purpose . Lets understand the scope of timers with the help of below figure.

– Timer A – applicable to Sampler A only

-Timer B – applicable to Sampler A and Sampler B

– Timer C – applicable to Sampler A, Sampler B and Sampler C

– The Timers are executed before the sampler’s execution

– The Timer execution time is not added to the sampler execution time

we have a script which has more than 1 requests inside a transaction.(Transaction controller).

Assuming we have jmeter script having 3 transactions having total 6 Requests/Samplers(Each transaction having 2 request).

Problem : As we have been take a look on the scope of a timer in jmeter, now we are facing problem and getting confused where we to put timer in the script as a think time between every 2 transactions. so that user execute transaction 1 then pause for the think time and then execute next transaction.

Solution : Right click on the “Thread Group” and select “Add Think Times to children” option.

Jmeter will add think time after each transaction in the script.It will add a “uniform Random Timer” as a child to “Test Action” element.

Change the Timer or timer’s delay as per your requirement.I have set Random Delay Maximum = 3000s and Constant Delay Offset 2000s.

Run your test and you can see the delay in “View Results in Table”.