Skip to main content

Command Palette

Search for a command to run...

JMeter

Published
3 min read

How JMeter becomes a saver for us!!!

As members of the QA team, Vivek and I were tasked with performance testing for our in-house Lead Management System. Our focus shifted to load testing for evaluating system performance. JMeter, a robust tool, empowers us to simulate varying user loads and assess the system's capability to handle concurrent activities effectively. Employing JMeter in JAVA initially, I used our in-house project URL (https://leadstaging.utkallabs.com/companies/create) as the server name/IP. The system encompasses three distinct roles: "Admin," "Sales," and "Delivery Owner."

Introduction to JMeter:

JMeter is a free tool made by a group called Apache to check how well websites and other computer programs work. It's useful for making sure computer programs are fast and stable.

JMeter is an open-source software tool designed for performance testing, load testing, and functional testing of web applications and other services. It is written in Java. JMeter is widely used for assessing the performance and stability of web applications, web services, databases, and more.

Benefits of JMeter:

  • Performance Testing: JMeter allows you to simulate a large number of users accessing your application simultaneously, helping you understand how it performs under heavy loads.

  • Load Testing: You can use JMeter to test how your application handles varying levels of load to ensure it meets the required performance standards.

  • Functional Testing: JMeter can be used for functional testing of web services and APIs by sending HTTP requests and verifying responses.

  • Protocol Support: It supports a wide range of protocols like HTTP, HTTPS, FTP, JDBC, SOAP, etc..

How to Set Up JMeter within Java:

To get started with JMeter you have to follow these basic steps:-

  • Install Java: JMeter is a Java application, so make sure you have Java installed in your system.
  • Download and Install JMeter: You can download JMeter from the Apache JMeter official website (https://jmeter.apache.org). After downloading unzip the archive file to your preferred location.

  • Launch JMeter: Run JMeter by executing the Apache JMeter.jar from the bin directory of the JMeter installation.

  • A Small Example Using JMeter:

    • Create a Test Plan: Open JMeter and create a new test plan by going to "File" -> "New Test Plan."

    • Thread Group Setup:

Right-click on the test plan and select "Add" -> "Threads (Users)" -> "Thread Group."

In the Thread Group settings, configure the following:

Number of Threads (users): 10 (simulating 10 users)

Ramp-Up Period (in seconds): 3 (time taken to ramp up all users)

Loop Count: 6 (each user will access the page 6 times)

  • HTTP Request Setup:

Right-click on the Thread Group and select "Add" -> "Sampler" -> "HTTP Request."

  • In the HTTP Request settings, configure the following:

Name: Enter a name for your request (e.g., "Hello Page Request").

Server Name or IP: Enter the URL of your web page (e.g., "https://leadstaging.utkallabs.com/companies/create").

HTTP Request: GET (for retrieving the page)

  • View Results: To view the results, right-click on the Thread Group and select "Add" -> "Listener" -> "View Results Tree."

  • Run the Test: Click the "Run" menu and select "Start" or simply click the "Run" button on the top toolbar.

  • Analyze Report: As the test runs, you'll see the requests and responses in the "View Results Tree" listener.

After the test is complete, you can analyze the results to check for response times, errors, and other performance metrics.