In this session, we will understand the significance of Thread in JMeter Test plan. We will understand the use of Thread Group and its component in this session.
What is Thread Group?
From the above diagram we can able to understand that, Thread group will simulate virtual Users and run the required test on the application. Thread is generally subset of Thread Group in JMeter Test plan. Thread group is generally created based on the scenario. This will execute a set of thread of same scenario.
Above screenshot is the example of Thread Group. It has some filed we should aware of. Let’s discuss the significance of each field.
- Name: This field signifies the name of the assertion which will be listed under the Thread. Name field is so crucial if you will be working with a big application having lots of validation and functionalities.
- Comments: Comments field is usually used to give comments to our Assertion. This field is optional.
- Action to be taken after a Sampler error: This field is used to specify that which action should be taken if sampler error occurs.E.g. Continue, Start Next Thread loop, Stop Thread, Stop Test, Stop Test Now etc.
- Number of Threads: This field simulates the number of virtual users to be tested.
- Ramp up period: Ramp up period is a crucial part of JMeter Thread. This defines how long to take enter all threads enter to the system. For example, if we configured the “Number of Thread” as 100 and “Ramp up Period” as 300, this will take 300 seconds to make all 100 thread users up and running. This means each will start 3 seconds after the previous thread started.
In general form we can define this scenario that Ramp up Period / Number of Thread will be the time difference between each consecutive threads.
- Loop Count: From the name you can guess the significance of Loop Count. Loop count is nothing but running the test multiple time. If we want to run our test 5 times, then we need to give 5 in Loop count field. If we need to run the test infinity times / forever, then we need to check the “Forever” check box.
- Same User in each iteration: If we check “Same User in each Iteration” then JMeter will use same user details to run the test in each iteration. If we don’t want that then we can leave this field unchecked.
- Delay Thread creation until needed: This signifies to add delay the thread creation until needed.
- Specify Thread lifetime: This will enable delays field if we check this check box. It will allow user to specify delay duration and start-up delay.
- Duration: This allows JMeter to run the test within the defined duration whatever mentioned in this field. The unit of this field is Seconds.
For Example, if we set Duration as 120, then JMeter will run the test for 120 seconds. After 120 seconds test will end
- Startup Delay: Startup delay is the time duration which used to delay the thread initiation. If we want to initiate the thread after 5 second, then we need to give 5 in Startup delay field.