JMeter tutorial

Learn to perform load and performance testing for a web application in this step by step JMeter tutorial. This Jmeter example is intended for beginners who are trying to use the Jmeter for the first time.

1. Download and start JMeter

1.1. Download JMeter

Go to Apache jmeter download page and download the distribution based on your machine. I am using a windows 10 machine, so I download the zip file.

JMeter download links
JMeter download links

Extract the downloaded package to a desired location.

1.2 Start JMeter

To run the jmeter, go to the folder the /jmeter/bin and run jmeter.bat file.

JMeter batch file to start
JMeter batch file to start

It will start the JMeter UI with no test plan initially. Now, it’s time to create a test plan for our web application’s load testing.

JMeter initial screen
JMeter initial screen

2. Create test plan

A useful test plan is created with minimum 3 components –

  • Thread Group – contains the simulation of multiple concurrent users. A single thread represent a single user. We can create any number of threads to put the desired load on the application. It also help us in scheduling the delay between two threads, and any repetition of request batches.
  • HTTP Request – consist the HTTP request configuration which thread group will be invoking. It is the application URL which you want to load test.
  • Listener – helps in viewing the result of the whole testing process. There are multiple listener available in jmeter to verify the testing results.

2.1. Create Thread Group

To create a thread group, navigate to ‘Right click Test Plan -> Add -> Threads -> Thread Group’.

Create Thread Group Option
Create Thread Group Option

Fill in the values as per your requirements (or based on your assumptions, we can change them anytime in future). Name the thread group and save it to any location in your workstation.

Thread Group Created
Thread Group Created

2.2. Create HTTP Request

To add HTTP request details, navigate to ‘Right click thread group -> Add -> Sampler -> HTTP Request’.

<Create HTTP Request Create HTTP Request[/caption]>

Fill in the application URL details which we are going to test. I am using the rest api created for Spring boot hello world example. the API URL is 'http://localhost:8080/employees'.

Filled HTTP Request
Filled HTTP Request

2.3. Add Listener

To see the results of test plan, add listener named “” by navigating to ‘Right click thread group -> Add -> Listener -> View Results Tree’.

Add Listener
Add Listener

3. Perform load testing

To perform the load testing, start the thread group using the green play icon at the top ribbon in tool.

Start Load Test
Start Load Test

Let all threads run and invoke the configured application URL. After the test is finished, we can review the load test results in consolidated manner in listener tab.

Load testing results
Load testing results

4. JMeter tutorial summary

In this JMeter example, we learned to use jmeter to perform performance testing of a web application or rest api in simple steps. We learned to create test plan, thread group, configure HTTP request and review results in JMeter.

Drop me your questions in comments.

Happy Learning !!

Comments

Subscribe
Notify of
guest
4 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.

Our Blogs

REST API Tutorial

Dark Mode

Dark Mode