Apache JMeter is a popular open-source performance testing tool used for load testing, stress testing, and performance testing of applications.
It is a Java-based application that allows you to simulate various scenarios to measure the performance and behavior of your software or web applications under different conditions.
Here are the few features of JMeter:
Protocol Support: JMeter supports a wide range of protocols and technologies, making it suitable for testing different types of applications, including HTTP/HTTPS, FTP, SOAP, REST, JDBC, JMS, and more.
User-Friendly GUI: JMeter provides a user-friendly graphical user interface (GUI) that allows testers to create test plans, configure test scenarios, and analyze test results without writing code.
Recording: — JMeter allows users to record HTTP/HTTPS to create a Test plan using Recording facility.
Reporting and Analysis: JMeter provides several built-in listeners and reporting options that allow you to monitor test execution in real-time and generate detailed reports and graphs to analyze test results.
Open source: JMeter is an open source software. This means that it can be downloaded free of cost.
You can start JMeter in 3 modes:-
GUI Mode
Server Mode
Command Line Mode
In this article, you will learn about how to perform testing using the JMeter in GUI Mode .
Installation
The minimum requirement for installing Jmeter on your windows system is that you should have Java version 8 or higher. You can verify Java version is 8 or higher by running the “java -version” command in command prompt:
2. Download the latest Binary from the official Apache JMeter website https://jmeter.apache.org/download_jmeter.cgi#binaries and Extract the downloaded file.
Navigate to the bin folder and locate the bat file “jmeter.bat” file and double click on that .bat file.
This will launch the JMeter in GUI Mode as in below screenshot:-
This is the Graphical User Interface(GUI) of Apache Jmeter . Using this we can perform the load testing for any website.
Now , we have successfully installed and launched Apache Jmeter on our system.
Step by Step Process to perform a basic Load Testing
Add a Thread Group
The Test Plan — is the highest-level element in JMeter, representing your entire test scenario. It contains all the other elements and configurations needed for your test.
Right click on the Test plan-> Add -> Threads(Users) -> click Thread Group
Thread Group — Thread Groups is a collection of Threads. Each thread represents one user using the application under test. The main features to perform load testing are the number of threads, ramp-up time, and loop count within a Thread Group.
Number of Threads (Users) :- This parameter represents the total number of virtual users that JMeter will simulate
Ramp-Up Period (in seconds) :- This value specifies the time duration for JMeter to create the total number of threads.
Loop Count :- This parameter defines how many times each thread should execute the test plan.
Here, we are providing No: of Virtual Uses as 100, Ramp-up Period 1 sec & Loop Count as 3.
2. Add a Sampler
Sampler — Samplers help the Thread Group to know which type of requests (HTTP, FTP etc.) it needs to make.
In our example, we will be adding a HTTP Request sampler.
Right click on the Thread Group -> Add -> Sampler -> click HTTP Request
Once the HTTP Request is selected , we should provide the url of the website we are planning to test.
Here, for our demonstration purpose we are taking website — https://blazedemo.com
We are providing the Protocol field as “https” .
In the Server Name field, we need to give the base domain ie “blazedemo.com”
Path Field is provided with the page specific path. Here, we are testing the home page so given as “/”
3. Add a Listener
Listener — Listeners display the results of your test in various formats, such as tables, graphs, and logs. Common listeners are:
Graph result listeners display the server response times on a Graph
Table Result show summary of a test result in table format
Log show summary of a test results in the text file
Graph result listeners display the server response times on a Graph
Right click Thread Group -> Add -> Listener -> Select a Listener from the list
Here, we are selecting Listeners — View Results in Table & View Results Tree
4. Save and Run the Test Plan
Test plan will be saved as a .jmx file. Click on the green Run button to execute.
Analyze the Results
We can view the results in listeners as below:
Table View:
Tree View:
Based on your analysis, you may need to adjust your test plan, increase the number of virtual users, or optimize your application to address performance issues.
Continue to refine and iterate your tests until you achieve the desired performance levels.
JMeter offers numerous advanced features, including scripting, parameterization, and distributed testing. As you become more comfortable with JMeter, explore these features to conduct more complex and realistic performance tests.
Starting with simpler tests and gradually progressing to more complex scenarios is a recommended approach for beginners.
Keep exploring… Happy Learning !
Comments