Running multiple Thread Groups sequentially in JMeter

TestingJmeterLoad TestingStress Testing

Testing Problem Overview


I have a Test plan in which there are multiple Thread Groups.
I want to run all of the Thread Groups sequentially.
Thread Groups are as below:

Thread Group1
Thread Group2
Thread Group3
. . .
Thread GroupN

I've read in different blogs and articles on the internet, people claiming that the thread groups will run in the order they are defined but apparently they are not in my case. Thread Group4 runs before Thread Group1. Thread Group4 is generating a report which is wrong because it runs before Thread Group1.

How do I ensure the ordering of my Thread Groups?


Also, I need to implement the following scenarios:

  1. Run a single request multiple time by a single user (Single user should create 1000 accounts from a single HTTP request).

  2. Run a multiple requests multiple times by multiple users simultaneously (Multiple users should create 1000 accounts simultaneously from a single HTTP request).

How to do so?

PS: Please read and understand the query carefully before replying.

Testing Solutions


Solution 1 - Testing

Concerning consecutive execution of thread groups in test plan: simple check Run Test Group consecutively check-box on the Test Plan configuration screen:

![enter image description here][1]


  1. Use e.g. Loop Controller for this:

Thread Group
Number of Threads = 1
Loop Count = 1
...
Loop Controller
Loop Count = N
HTTP Request
...

or even schema without Loop Controller but not so flexible:

Thread Group
Number of Threads = 1
Loop Count = N
...
HTTP Request
...

  1. Use Number of Threads property of standard Thread Group for this together with Ramp-Up Period property:

Thread Group
Number of Threads = N
Ramp-Up Period = 0
Loop Count = 1
...
HTTP Request
...

This will start N simultaneous threads executing same scenario. [1]: http://i.stack.imgur.com/93TLc.jpg

Solution 2 - Testing

Check the Run Thread Groups consecutively (i.e. run groups one at a time) in the Test Plan.

Solution 3 - Testing

  1. Just add more thread groups in your test plan.
  2. In test plan properties -> tick Run Test Group consecutively for step by step execution of thread groups.

Solution 4 - Testing

Here is the simple solution which I found for Running multiple Thread Groups in particular order:

  1. Check the option "Run Thread Groups consecutively" under "Test Plan"
  2. Order your "Thread Group/s" in the order you want to be executed using drag and drop approach

Solution 5 - Testing

Refer this link. This asks you to check the check box in the main Test Plan

Run Thread Groups consecutively (i.e. one at a time)

http://www.mahsumakbas.net/run-jmeter-thread-groups-consecutively/

Solution 6 - Testing

Regarding Alies Belik answer, there is another way than running thread group consecutively

which is to use Setup Thread Group for the first part.

Regarding setting ramp-up period, it is better to set a value > 0,

which is more realistic one as depending on the number of threads

to start it could delay there startup, the more you have the more it takes time to start.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJust_another_developerView Question on Stackoverflow
Solution 1 - TestingAliaksandr BelikView Answer on Stackoverflow
Solution 2 - TestingAdnanView Answer on Stackoverflow
Solution 3 - TestingMangesh BhapkarView Answer on Stackoverflow
Solution 4 - TestingTsvetoslavView Answer on Stackoverflow
Solution 5 - TestingFirenzeView Answer on Stackoverflow
Solution 6 - TestingUBIK LOAD PACKView Answer on Stackoverflow