How To Do Performance Testing Using JMeter?

Performance testing is to test the speed, reliability, response time, and resource usage. The goal behind performance testing is to identify and eliminate any potential resistances to the software application.

JMeter is an open-source, Java-based software. It is used to perform load testing, functional behavior, and measuring performance. JMeter performance testing is the process of testing the performance of a web application using JMeter.

Table Of Content

Let’s Start with Prerequisites. These things are required in your system before you start with JMeter performance testing.

Prerequisites

  • Install Java in the system (Windows, Linux, Mac OS)
  • Download JMeter. Click Here
  • Install JMeter Report Plugins To Generate report

1. Download the JMeter plugins Click here

download the JMeter plugins click here

2. Replace the lib folder with downloaded JMeter plugins

replace the lib folder with downloaded JMeter plugins

JMeter Performance Testing Steps (Process)

Launch JMeter

Move to the extracted folder to open the program.

Run the jmeter.bat (Windows Batch File)

run the JMeter bat

Record JMeter Script

Record JMeter script means adding data in JMeter that is used to perform testing. There are multiple ways to record JMeter test case scripts for performance testing.

Method 1:Adding Manual Record from JMeter

For the basic program, refer to our previous article on JMeter Performance Testing for Beginners. In the previous article, we have explained manual record entry.

method 1

There are other methods as well to record data for advanced users. But before you go further, we need to setup the thread group:

Method 2: Use .CSV for multiple users

There are multiple steps involved in the process of adding. CSV records. Here is the step-by-step process to use. CSV for multiple users entry.

method 2 step 1
Step 1 - Create login.csv with two columns (username and password) and save it to your preferred location.

method 2 step 2

Step 2 - Right Click on “Thread Group” & Add & Config Element & CSV data set config.

method 2 step 3


Step 3 - In “Filename” field, click on browse and select the file(Login.csv) you have created.

method 2 step 3

Step 4 - Add “Column names” in Variable Names field.

method 2 step 4

Step 5 - Right Click on “Thread Group” & Add & Sampler & HTTP Request

method 2 step 5

Step 6 - Pass the variables as Parameters in HTTP request

(Add Name: Email, Value: ${username}, Name: Password, Value: ${password} )

Method 3: Use a recording tool for the JMeter script.

In this method, we need tools or extensions to record our actions and data for JMeter script. There are various tools and extensions to perform such functionality. We have mentioned three as we found them easy to use. All recorded script is downloaded in .jmx format.

badboy you can download this tool from here
Badboy - you can download this tool from here.

selenium ide using jmeter plugin

Selenium IDE using JMeter Plugin - you can download this plugin from here

BlazeMeter plugin - you can download this plugin from here. This plugin is only available in the Chrome browser.

blazemeter plugin you can download this plugin from here

Once the recording is done, you need to open file in JMeter. For that, Go to File & open. And select recorded .jmx file/script.

and select recorded .jmx file

Execute JMeter Script

It's time to execute JMeter script and get the result. There are two formats to generate results in JMeter. One is Generic and available to all, and another is advanced that needs to install Plugin.

Default Report Format

Step 1 - Right Click on “Thread Group” & Add & Listener & Result Tree

default report format

Step 2 - To run the JMeter program, Save the script and Click on Run Button or Press Ctrl+R

default report format step 2

Advance Report Format Using plugins

In this advance report format, we will use the report we installed in the "Prerequisites" section of this article. We will showcase five types of reports:

Active Thread Over Time -

- This report showcases that how many active threads are there in each thread group during the test run. To generate the report, you need to

Right Click on “Thread Group” & Add & Listener & click on “Active Thread Over Time”.

active thread over the time

Response Times Over Time

- In this report, you will get the amount of time it takes for a server to respond to a client's request. To generate the report, you need to

Right Click on “Thread Group” & Add & Listener & click on “Response Time Over Time”.

response time over time

Hits per Second

- This report represents the number of requests sent to the server in one second.

To generate the report, you need to

Right Click on “Thread Group” & Add & Listener & click on “Hits per Second”.

hits per sound

Composite graph

- As per the name, it combines three charts in one report. This report generates a graph with three components: active thread, server hits per second, and response time.To create the report, you need to

Right Click on “Thread Group” & Add & Listener & click on “Composite Graph”.

composite graph

Stepping Thread Group

- It creates ramp-up and ramp-down scenarios in steps as part of JMeter load testing with different criteria/parameters. To generate the report, you need to

Right Click on “Thread Group” & Add & Listener & click on “Stepping Thread Group”.

stepping thread group

Conclusion

JMeter is one of the performance testing tools that can help expert to run performance and load testing for web applications. We have explained how you can create records/data and get the test report of your application. This way, you can improve the performance of your application.

About Author:

Kevin Patel.pngKevin Patel started his career as QA in Feb 2016. Currently, he is associated with Pixel QA as a Senior QA engineer. He has achieved two major certificates in QA Testing in different domains like accounting, e-commerce, healthcare, and payroll.

He loves challenges, team handling, and client communication. He would like to progress in his career as QA Consultant in the IT field by achieving more QA standards.