Get Started with JMeter

Updated 25 April 2018

Facebook Linkedin

This Article is a part of series of article that explains how we perform load testing and performance testing with JMeter.

Before we start with today’s topic, i mention all key points below which we discuss in this article and these are :

  • Thread Group
  • sampler
  • Assertion
  • Listeners

Thread Group

Thread Group is a collection of thread and each thread will represent one user who is using this application, so we can say that each thread will interact one user request to the server.

To control the users you can set value according to your own way like For example if you set the number of threads as 100, JMeter will create and fetch 100 user requests to the server under test.

Here in above diagram number of user are 100 and Ramp-up show that total time in seconds taken by the user to hit the server i.e 100 seconds, So calculation for per user is :

Number of  seconds (single user) = Number of Thread (Total users)/Ramp-up periods ( Total time )

1 second taken by one user to hit the server with the request.


Sampler allows JMeter to send different type request to a server. Sampler is the actual request that JMeter sends to a web server. Each Sampler generates Sample request which can be viewed in listeners. Now about listeners  we discuss later, first i will discuss sampler here. Below i mention how we add sampler in JMeter.

Right click on Thread group and  then Add -> Sampler -> HTTP Request

As we know already that JMeter supports testing HTTP, FTP, JDBC and many other protocols. But here in this blog, we will study only HTTP request.

Below is an example for HTTP request for www.uvdesk.com,  now what is server name or IP and path i mention in below diagram.

  • Server Name or IP and Path

Suppose you want to go www.uvdesk.com and you want to sign up free in UVdesk panel then set Server Name with www.uvdesk.com and open the URL go to Sign up free and then copied the URL which is next to www.uvdesk.com,  I  copy the whole URL and paste in place path. Below I explain in the diagram:

There is Most important part in the sampler which is HTTP Default Request. HTTP default Request is used for multiple HTTP Request with different path name and same Server name or IP.

For example, if you are creating a Test Plan with 25 HTTP Request controllers and all of the requests are being sent to the same server, you could add a single HTTP Request Defaults element with the “Server Name or IP” field filled in. Then, when you add the 25 HTTP Request controllers, leave the “Server Name or IP” field empty only fill path field with your desired URL. The controllers will inherit this field value from the HTTP Request Defaults element.


A listner is a component which shows our sample result that means each HTTP Request in Tree, Tables and a graph. These Results show data related to Thread users which are represented in below diagram and To view the result add either of the listners i.e “View Results Tree” or  “View Results in table” to view the response graphically in form of graph result.

In above diagram, we have many points sample, start time, Thread name, label, sample time, and status these are explained below:

Sample: This indicates the number of user per request.

Thread Name: Number of user request go to the server, for the first user it shows 1- 1, for the second user it shows 1-2 like so on.

Label: HTTP request going to the server.

Sample Time: It is a difference between the time when the request was sent and when the response has been fully received.

Status: It shows right green tick means all request passes by the server.

View Result in Tree

View Result in tree generate data that JMeter sampler generates and this contains all samples and Request and Response data and in sample result, we have data which I mention below and this data is related to particular HTTP Request and Below data show for Thread group 1-1 and for Thread group 1-2 it is different.Thread Name:  These are our Thread user which are divided in Thread Group 1-1

Thread Name:  These are our Thread user which are divided in Thread Group 1-1.
Sample Start:  This show our sample start date and time i.e 2017-09-12 17:36:17 IST
Load time: This shows the total time between first-byte load and last byte which is  7839
Latency:  The latency is a waiting time from the point of sending a request to the receiving first byte of the response which is  918.
Size in bytes: It is a size of Headers Size + Body Size which is 91719.
Sample Count: For particular counting HTTP Request i.e 1
Error Count: If not receive any error i.e 0
Response code: 200
Response message: OK

and Assertion Result that is generally related to the particular sampler.  Now, what is Assertion that i mention in Assertion part , Here below i explain graph generated by view result in tree method.


A request is HTTP Request which is  http://www.uvdesk.com/en/apps/?category=ecommerce-integration.

Response data

Response data is a data which is fetched from that HTTP Request, it is in form of HTML and for every HTTP Request Response data is different.

How to use Assertions in JMeter

First question in your Mind that what is Assertion and why we use it in JMeter, So when our request hit to server, Assertion help us to verify that your server under running test will return expected Results  or Not, whether it doesn’t contain, doesn’t match or doesn’t equal the expected response. Following are some commonly used Assertion in JMeter.

Response Assertion

In JMeter here Right Click on Thread Group ->  Add ->Assertion -> Response Assertion

So in JMeter 3.1,  we are able to create an Assertion-based  combination  of :

  • Apply to: where to apply Assertion.
  • Response Field to Test – where or in which field we want to apply Assertion.
  • pattern Matching Rule – whether the expected the response should (Not)Contain, (Not)Match, (Not)Equal or (Not)Substring).
  • Pattern To Test :
  • 404: Server error

  • 200: Server OK

  • 302: Web server redirects to another page.

Duration Assertion

Duration Assertion Means it validate that each Response is received in a given interval of time or not,  because sometimes it happens too late or delay in opening of any site while it time is in milli seconds, So here we check by adding, Duration Assertion that our server request will fetch in that limited time or not,  if any response that takes longer than given number of milliseconds (specified by user) is recorded as failed response.

Right click Thread Group, Add -> Assertions -> Duration Assertion

So if you want to see Assertion Result, Right click Thread Group, Add -> Listener -> Assertion Results Here below is your Assertion Result

Size Assertion

The Size Assertion Test is that each response will contains the expected number of byte in it or maybe response not contain an expected number of bytes. You can specify that the size is equal to, greater than, less than, or not equal to a given number of bytes.

Suppose JMeter sends a user request to www.google.com and gets a response with size less than expected byte 5000 bytes (specified by user) then test case pass. If else, test case failed.


So if you want to see Assertion Result Right click Thread Group, Add -> Listener -> Assertion Results 

Here below is your Assertion Result.

Here i have filename i can add my any file here and then all my data is recorded in that. So in case if you don’t want to display data you can add your data in any document, and below i save my data in jmeter.CSV and it show my HTTP Request response and Thread group name.

XML Assertion

The XML Assertion tests that the response data consists of a formally correct XML document.

HTML Assertion

The HTML Assertion allows the user to check the HTML syntax of the response data. It means the response data must be met the HTML syntax.


. . .

Leave a Comment

Your email address will not be published. Required fields are marked*

Be the first to comment.