Professional Documents
Culture Documents
JMeter Features
Following are some of the features of JMeter −
• It has a simple and intuitive GUI.
• JMeter can conduct load and performance test for many different server types
− Web - HTTP, HTTPS, SOAP, Database via JDBC, LDAP, JMS, Mail - POP3,
etc.
o Test Plan
o Thread Group
o Controllers
o Listeners
o Timers
o Configuration Elements
o Pre-Processor Elements
o Post-Processor Elements
Test Plan
A test plan can be visualized as your JMeter script for running tests. A test plan
consists of test elements such as thread groups, logic controllers, sample-
generating controllers, listeners, timers, assertions, and configuration elements.
A test plan consists of all steps which execute the script. Everything which is
included in a test plan is executed in a sequence which is top to bottom or as per
the defined sequence in the test plan.
Thread Group
As the name implies, thread group represents the group of threads JMeter will
use during the test. Thread group elements are the beginning points of any test
plan. The controls provided by a thread group allow you to:
The steps to add a thread group in your test plan had been explained earlier in
the Add/Remove test elements portion
The following image shows the control panel portion of a thread group.
Controllers
Logic Controllers help you to control the flow the order of processing of
samplers in a thread. It can also change the order of requests coming from their
child elements.
Samplers
Samplers are the components which allow JMeter to send specific types of
requests to a server.It simulates a user's request for a page to the target
server.Samplers are a must to add component to a test plan as only it can let
JMeter know what type of request need to go to a server. Requests could be
HTTP, HTTP(s), FTP, TCP, SMTP, SOAP etc.
Listeners
Performance testing is all about analysing server responses in various forms and
then presenting the same to the client.Listeners provide pictorial representation
of data gathered by JMeter about those test cases as a sampler component of
JMeter is executed. It facilitates the user to view samplers result in the form of
tables, graphs, trees or simple text in some log file.Listeners can be adjusted
anywhere in the test, including directly under the test plan.
Timers
When you perform any operation on a website or app, they naturally have
pauses and delays. These can be simulated with Timers.
Configuration Elements
Working of configuration elements is quitesimilar to those of
samplers.However, it does not send requests but it allows you to modify the
requests made by the samplers.
It is a simple element where you can collects the corporate configuration values
of all samplers like webserver's hostname or database url etc.
Post-processor Elements
A Post-processor element is executed after a sampler request has been made. If
a Post-Processor is attached to a Sampler element then it will execute just after
that sampler element runs.A Post-processor is most often used to process the
response data, for example, to extract a particular value for future purpose.
Step by Step process for Load testing in Jmeter:
Step 1 – Install Java:
JMeter is pure Java desktop application and it requires a fully compliant JVM 6
or higher. You can download and install the latest version of Java SE
Development Kit.
The Latest version of JMeter available is 5.1. You can download any
of the binaries.
Right click Test Plan, Add -> Listener -> Graph Results
Right click on the "Test Plan" and add a new thread group: Add -> Threads
(Users) -> Thread Group
Case-1:
Thread properties:
No.of.threads(USERS):100
Ramp-up period(seconds):10
Loop count:10
1. Start JMeter
2. Select Test Plan on the tree
3. Add Thread Group
Right click on the "Test Plan" and add a new thread group: Add -> Threads
(Users) -> Thread Group
Case-2:
Thread properties:
No.of.threads(USERS):1000
Ramp-up period(seconds):20
Loop count:20
1. Start JMeter
2. Select Test Plan on the tree
3. Add Thread Group
Right click on the "Test Plan" and add a new thread group: Add -> Threads
(Users) -> Thread Group
Case-3:
Thread properties:
No.of.threads(USERS):100
Ramp-up period(seconds):10
Loop count:Infinte
Step 3: Create HTTP Request Defaults
This element can be added by right-clicking on the Thread Group and
selecting: Add -> Config Element -> HTTP Request Defaults.
In the HTTP Request Defaults control panel, enter the Website name under test.
In the HTTP Request Defaults control panel, enter the Website name under test.
OR