1. Thread Groups:
To start building the test script, we need to
add a Thread Group.
Thread
groups determine the user flow and simulate how users behave on the app. Each
thread represents a user.
In layman’s
words, Thread group allows us to design the execution process of performance
testing like how many users, no of iterations,
Type of Thread
Groups:
-
Thread group
-
setUp Thread Group
-
Tear Down Thread group
-
Stepping Thread Group (plugin
in Jmeter)
-
Ultimate Thread Group (plugin in Jmeter)
1.
Thread Group: this is basic type of group provided by JMeter
with simple load test configuration. We can you this group if we want execute
test like only loop, but we cannot define static load duration in this type. Also,
we cannot plan step down or ramp down in this scenario
2.
setup Thread group: now think in some cases, you need to do
something before running your tests, we can use the setUp Thread Group.
Let’s see
the important aspects of this thread group:
-
setUp
Thread Group perform Pre-Test Actions
-
setUp
Thread Group will be executed BEFORE
the test proceeds to the executing of regular Thread Groups
so, we
need to understand when we can use setup thread group. Let’s see some examples:
-
Make a
list of users that need to be run in your tests.
-
Get the
data from the database and store into the .csv files or JMeter variables and
use them during the test.
-
Send the
email or any kind of notification to notify that the test has been started.
-
Perform
some logic based on the user input via command line.
3.
Teardown Thread group: Similarly, like setup thread group, tear down
thread group is also a special element. This one can be used for performing
Post-Test Actions. This one will be executed AFTER the test proceeds to the executing of regular Thread Groups.
Please
note that No matter where these elements
are, they will always execute as the rule which describes above.
i.e. So,
even the tearDown displays first, and setup is in the last of Test Plan tree,
but while running, the order is still the same: setUp –> normal thread group
–> tearDown.
so, we
need to understand when we can use teardown thread group. Let’s see some
examples:
-
Also, we
need to be careful while configuring teardown thread group,
-
Send the
email or any kind of notification to notify that the test has been stopped.
-
Collect
some reporting stuff on response data
-
To
delete test users after completion of the test
-
To delete bulk of data/order/pending request
after completion of the test
-
To clear/delete dataset from a database for
next run.
Please
note that by default, tearDown Thread Group
won’t run if the Test is completed as expected. If you want to run it anyway,
mark the check-box “Run tearDown Thread Groups after the shutdown of main
threads” from Test Plan element.
4.
Ultimate Thread group: Just suppose we need to perform load test for
1000 virtual users where in single execution different User slots (250, 100,
150, 200, 300) follow separate Ramp-up Time(Startup time), Ramp-down
Time(Shutdown time) & ‘Hold Load for’ time.
A
standard thread group is not capable of fulfilling such requirement.
To apply such conditional load on server we
have to use Ultimate Thread Group. Using Ultimate Thread Group you can define
initial delays and setup duration of
run. With use of Ultimate Thread Group, we can take entire control of
performance test execution by configuring infinite number of schedule records
& separate ramp-up time, shutdown time, flight time for each schedule
record. also generate variety of load patters based on requirement and
configure perfect Spike Test
To use
Ultimate thread Group we need to download the jar files.
How to download “Ultimate Thread Group”
plug-in?
1. Click
on the link to download Ultimate Thread Group JMeter Plugin
2. Unzip
the folder
3. Copy
the file jmeter-plugins-cmn-jmeter-<version>.jar to lib folder of Apache
JMeter
apache-jmeter-<version> –>lib –>
Paste jmeter-plugins-cmn-jmeter-<version>.jar
4. Copy
the files jmeter-plugins-casutg-<version>.jar and
jmeter-plugins-manager-0.10.jar to ext folder of Apache JMeter
apache-jmeter-<version>
–>lib –>ext -> Paste jmeter-plugins-casutg-<version>.jar and
jmeter-plugins-manager-<version>.jar
5.
Stepping Thread group: The Distributed load can be form by adding
Stepping Thread group as well. Here the
difference in Ultimate and Stepping Thread group is in Ultimate thread group
each thread will start one by one but in stepping thread group we can start
group of threads at a time.
By using Stepping thread group, you can
configure increment of thread load by portions, setup the hold load time and
also decreasing the user load by portions. The feature of Stepping Thread Group
is we can configure own Performance
Test. It will generate appropriate graphical presentation based on designed
configuration. we can easily understand the nature of execution and modify the
way we want.
How to download stepping thread group:
Stepping
Thread Group is the feature of JMeter Plugin to test distributed load on
server. Please follow below steps to get it installed for JMeter installation:
1)
Download standard set of plugins from this URL: https://jmeter-plugins.org/
2)
Extract the Zip file on desired location and copy the JAR file contained in
lib\ext folder.
3) Paste
the JAR file to $JMETER_HOME/lib/ext directory.
4) Also,
copy all the JAR files contained in lib directory of the extracted location to
$JMETER_HOME/lib folder.
5)
Restart/Launch JMeter and it’s done.
We
covered the types of thread group and usage.
I will cover configuration of thread group in next post.
Happy
testing.
Comments
Post a Comment