Getting Started with Apache JMeter

Apache JMeter Tutorials

1. Introduction

As a developer, you may have tested the functionality of your code hundreds of times during development. This is known as functional testing. Despite how familiar you are with your product, users will approach it differently and have many different use cases. That’s why you need Non-Functional Testing (NFT).

Performance, Security, Usability, and Reliability are just some of the many NF aspects that can be tested to ensure a better user experience. Apache JMeter is one of the best ‘Open Source and Free Tool’ that you can use for NFT. It can be used to perform Load Testing, Performance Testing, Scalability Testing, and more.

2. Watch Installation Video

3. Download and Install

  • Step 1: Install the latest version of the Java SE Development Kit. Download it here.
  • Step 2: Download the latest JMeter binaries from here.
  • Step 3: Install and launch JMeter as follows:
    • Unzip the downloaded JMeter zip file to the intended install folder.
    • Open the extracted folder and go to \Apache JMeter\apache-jmeter-5.2.1\bin.
    • Run the ‘.bat‘ file and you are good to go.
  • Step 4: Identify the basic components of JMeter.

Now you have a basic idea of JMeter and its components. Let’s try a real-world example for a better understanding. Simply follow these steps to test youtube.com as our website.

4. Creating a Test Plan

Let’s start by creating a New Test Plan for our test.

  1. Start JMeter
  2. Go to File > New and add a Test Plan and give it a name.

5. Adding a Thread Group

This section details setting up a certain number of Threads that will be used for our test. You can do so by following these steps:

  1. Right-click on the newly created Test Plan which will be displayed in the Test Plan Pane.
  2. Click Add > Threads (Users) > click Thread Group

Then you have to add the thread properties by clicking your thread group. You can add the Thread name and thread properties that are suitable for your test. I added data as follows:

Based on my values:

  1. Number of Threads: 100 users being connected to our Server application will be simulated.
  2. Ramp-up Period: The 100 threads will be generated within a period of 10 seconds.
  3. Loop Count: The test will be looped (repeated) 10 times.

Also, you can define thread time and thread start delay if needed. I have not used those features in order to keep this tutorial simple.

6. Adding JMeter Elements

Elements are individual tests that will be executed as part of our Test Plan.

HTTP requests can be added by right-clicking the newly created Thread Group and selecting Add > Config Element > HTTP Request Defaults.

In the HTTP Request Defaults add your website name under Basic > WebServer > Server Name or IP:

7. Making HTTP Requests

You can add an HTTP Request by right-clicking on Thread Group and selecting Add > Sampler > HTTP Request.

JMeter HTTP Request Sampler lets the user send HTTP/HTTPS requests to the webserver that we need to access. If we need to access the trending section on YouTube we can simply add /feed/trending in the path section.

I have not added the path here so that our tests are executed on Youtube.com servers.

8. Graph Result Implementation

To add graphically viewable results just Right-click the newly created Test Plan, select Add > Listener > Graph Results.

9. Run and Get the Results

Firstly, save your work. Now run your tests and obtain the results by clicking the “Run” button on the Menu Bar. The real-time results will be displayed on Graph Results.

The above results show the results for our tests on youtube.com:

  • Red: Shows the Standard Deviation of our results.
  • Black: Signifies the number of sample requests that have been sent to the server.
  • Blue: Represents the average number of samples sent.
  • Green: Represents the throughput of our results. It refers to the total number of requests handled per minute by the server.

Throughput and Deviation are the most important parameters that we can use to analyze our results. If the throughput is high, we can generally assume that the server has performed well, though this is not always the case. On the other hand, if the Deviation is low, we can assume our web application has performed well.

The above graph results show high throughput and low deviation. These results are very good and they are no surprise considering that YouTube is a popular service. It has been highly optimized in terms of both server performance and web application performance.

I recommend that you try JMeter to analyze your web application because of its simple GUI, free open-source nature, support for a variety of server types, and platform-independent nature. It will make your testing process much smoother and more convenient.

Tushar Sharma
Tushar Sharmahttps://www.automationdojos.com
Hi! This is Tushar, the author of 'Automation Dojos'. A passionate IT professional with a big appetite for learning, I enjoy technical content creation and curation. Hope you are having a good time! Don't forget to subscribe and stay in touch. Wishing you happy learning!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

JMETER TUTORIALS

Recent Posts

RELATED POSTS

Getting Started with Selenium WebDriver

Table of Contents 1. Selenium and Selenium Web Driver 2. Setting-Up the Environment 3. Test Script with Selenium Web Driver 3.1) Creating a project 3.2) Creating...

How To Record Using BlazeMeter Plugin (JMeter)

Honestly speaking if you already have a mature or established process using 'native' JMeter from Apache, without any kind of wrappers utilities or third-party...

VBS Part 1 – Introduction and Background

At the upfront, this theoretical article might look boring to most of us but still, it is advisable to know about our scripting friend...

Working with Selenium WebElements

Table of Contents 1. Selenium WebElements 2. WebElement Locators 3. Working With Text Box 4. Working With Buttons 5. Checkboxes and Radio Buttons 6....

Â

CHECKOUT 'HOW-TOs'

How To Install Oh-My-Posh On Windows PowerShell

Oh-My-Posh is a powerful custom prompt engine for any shell that has the ability to adjust the prompt string...

MORE ON CODEX

MORE IN THIS CATEGORY

A Prologue For HP Load Runner

Performance testing is one of the important processes of the software QA segment. While the application is efficiently designed and tested for functionality, it...

How To Find Broken Links with Selenium

What is a broken link? Links are used for navigating between webpages. Users are directed to a web page when they click or type a...

Getting Started with Selenium WebDriver

Table of Contents 1. Selenium and Selenium Web Driver 2. Setting-Up the Environment 3. Test Script with Selenium Web Driver 3.1) Creating a project 3.2) Creating...

HP Borland’s Silk Test for Multi-Channel Testing

The growing web and mobile applications have posed several challenges for software QA teams. While usability and scalability are highly prioritized, compatibility across multiple...

OTHER TUTORIALS

How To Configure Virtual Hosts in XAMPP

Apache has made it very easy to have multiple websites or web applications running on the same physical server,...
- Advertisement -spot_img