JMeter tips and tricks – Part 2Rahul Goel
Further to our previous blog here is the next one:
How to run JMeter test plan for specified amount of time?
There are two ways to specifying certain amount of time to run a JMeter test plan.
- In the Thread Group Element, Check scheduler and specify the Duration in seconds. If you want to run Jmeter test plan for 30 minutes then enter 1800 as shown below.
- Create a Thread Group which should contain your actual samplers.
- Add two Test Action samplers to the above Thread Group
Add -> Sampler -> Test Action
- Click on Test Action 1 and enter below setting.
Select Target as Current Thread and Action as Pause and enter 1800000
Milliseconds (30 minutes duration). This sampler acts as a Pause.
- Click on Test Actin 2 Sampler and specify below settings.
Select Target as All Threads and Action as Stop. This sampler stops the
Execution once it reaches the specified duration
- Make sure you unchecked Run Thread Groups consecutively option in Test Plan.
Summary: When we want to execute the load test for specified amount of time i.e. 2 hrs. Then we go for above either of two techniques.