Any test plan must start with the thread group items. It’s essential to make every effort to properly replicate user behavior while discussing performance testing. Virtual user groups are represented by thread groups in JMeter. The thread group element governs how many threads JMeter will employ to run your test, as its name suggests.
In this article, we will get to know about thread groups, their properties, and adding thread groups in your test plan.
What Are Thread Groups?
A collection of threads is called a thread group. Each thread corresponds to a single user testing the application. The fundamental part of a JMeter testing plan is a thread group. As implied by the name, a thread group consists of a number of threads that are working on the same situation. In essence, every thread imitates a single authentic user request to the server. The number of threads for each group can be set using the settings for a thread group.
This is regarded as the start of a test plan. Other test components like controllers, samplers, and configuration items are stored in thread groups together with the listeners. While the test plan is being conducted, each thread in the thread group will independently execute each element under the thread group.
Number of Threads
The number of threads indicates how many virtual users we anticipate will connect to the server. For instance, if we specify 10, JMeter will create 10 virtual users who connect to the server and carry out the specified actions. It is configured to 1 thread by default.
This is the amount of time that JMeter needs to start the previously indicated number of threads in a running state. It is provided in seconds. For instance, we should type 180 into the blank to indicate that we want to offer 3 minutes. It is set to one second by default.
This shows the number of times each thread was expected to complete the task. The identical procedure will be carried out eight times if there are four threads and two loops. The task will keep running until the test is stopped if this value is set to infinity. Iteration one is the default value.
You use this In order to plan a test run. Selecting this checkbox will activate the Scheduler Configuration panel at the bottom. The schedule option is also very useful in soak and endurance testing.
Using the Scheduler Configuration section, users can also set the load test plan’s duration, start up delay, start time, and end time. The Scheduler check box from the Thread Properties section mentioned above must be checked to enable this settings area.
Types of Thread Groups
Now that we have understood what thread groups are and what they are made up of, let us look at the different types of thread groups.
Arrivals Thread Group
Arrival is the start of thread iteration.
Concurrency Thread Group
Although the objective in this case is to have control over the number of concurrent users over a period of time, this thread group is still appropriate for goal-oriented scenarios.
Freeform Arrivals Thread Group
The only distinction between it and the arrivals thread group is that this thread group lacks choices for ramp up time and steps.
Ultimate Thread Group
In contrast to arrivals, freeform, and concurrency thread groups, the ultimate thread group provides a wide range of customizing settings and kills active threads when the predetermined length of time has elapsed.
Concurrency Thread Group
This is a later version of the stepping thread group and requires a little more setting to use. The ramp-up and ramp-down are the only things that are altered, although the overall outcome is essentially the same.
How to Add a Thread Group to Your Test Plan?
Let’s briefly explore how to add thread groups to a test plan.
First, run the bin/jmeter.bat file to start JMeter. The test plan is the first thing you see when the application opens, as illustrated in the following picture.
There are numerous alternatives available when you right-click on ‘Test Plan’. Here you will choose ‘Add’ and follow the following path: Test Plan > Add > Threads (Users) > Thread Group (see image below).
You can see that the test plan now includes the thread group.
I hope this article gave you a thorough understanding of what thread groups in JMeter are and how to add them to a test plan. You have the option of customizing your tests using the JMeter thread group feature.
There are several thread groups available, and they can be configured to mimic user interactions with the software (including how and for how long the interaction is to be simulated). Especially with JMeter thread groups, though, we can employ several thread group kinds. That is why it is great for working with thread groups and worth the effort of figuring out how it is to be used.
Follow Techdee for more!
Leave a Reply