Creating a Test Plan in JMeter

Manul Wickramanayaka
Test Automation Hub
4 min readMay 9, 2021

--

In this article, we will learn how to create our first JMeter test and how to use Listeners in the test plan.

1.Thread Group

First, just right click on the Test Plan and create a Thread Group.
Test Plan→ Add → Threads → Thread Group

This is the place that we are going to create our test plan. The figure below shows the editor section of the Thread group.

Thread Group editor

We can always change the Name of the Thread group and the important section is coming under the Thread properties section.
No of Threads →user load that we are going to test under the certain time frame
Ramp-up period →time frame that above user load will do the action
Loop count →how many iterations we want to do for the test

let's have those values for the test plan we are going to execute.
No of Threads →10
Ramp-up period →5
Loop count →1

This means that we are going to run 10 users within 5seconds for 1 loop count.

2.HTTP Request

To add, the HTTP Request right clicks on the Thread Group.
Thread Group →Add →Sampler →HTTP Request

For simple test let's try the vehicles section of the ‘ikman.lk’.
https://ikman.lk/en/ads/sri-lanka/vehicles

ikman.lk

Refer below editor section of the HTTP Request

HTTP Request editor

Server Name or IP→ main URL that we are going to test
Protocol →protocol of the site. (if it is HTTP site we do not need to mention it here. just leave it blank)
Path →the actual URL path we are going to test.

As we only need results for the moment let's keep HTTP Request section as “GET”

So the HTTP Request part is complete now.

3.Adding Listeners

However to view the results in the above test we need something where we can see the reports or results and that component is called listeners.

To add listeners right click on the Thread Group,
Thread Group →Add →Listeners

In here we could find several listeners and for this test, let's take only a few.

Here we completed all the prerequisite for our first JMeter test.

4. Let's run our first Test Plan

Before running the test first save it as .jmx file in any location on your computer

Now we need to run our test by clicking the green arrow icon in the main toolbar.

And in the right corner of the main toolbar you could see the progress.

Let's have a look at the reports generated from JMeter.

View Results Tree

In View Results tree it shows all the tests are passing with the matching response code of 200

View Results in Table

In the View Results Table we can see tests in a table view with each test element attributes.

Aggregate Report

Aggregate Reports shows us the Test passing rate with a percentage.
normally when we write test cases we take the 95% line as the average.

Here we completed our first test plan and successfully executed the test.
In the next section, let's talk about the Logical controllers and the HTTP(S) Test Script Recorder.

THINK QUALITY!

--

--