Skip to content Skip to navigation
Check Our New Demo Website!

JMeter HTTP Request Sampler Example

In the previous tutorial, we have seen some basic information on sampler. Here we will try to understand in detail about most commonly used sample which is HTTP Request sampler with example.

Let us now create a plan to test an web page using HTTP Request Sampler. This sampler lets us to send an HTTP/HTTPS request to a web server. If we want to send multiple requests to the same web server, we should consider using an HTTP Request Defaults Configuration Element so that we do not have to enter the same information for each HTTP Request.

Step 1:- Add Thread group to execute the components of the test and configure thread group properties. Refer Thread Group details with example
Right Click on Test Plan -> Add -> Thread ->Thread Group

Apache JMeter Thread group Structure

Step 2:- Add HTTP Request Sampler for this thread. Right Click on Thread Group - Add -> Sampler -> HTTP Request
After adding the request, we need to define the properties for this request as below:

Apache JMeter HTTP Request Structure

Step 3:- Set the name of the serve that we want to test. Example google.com, Path as /about and Protocol[http] as https

Apache JMeter HTTP Request Structure

Step 4:- Add Listener for this thread. Right Click on Thread Group > Add > Listener > View Results Tree. This shows a tree of all sample responses, allowing us to view the response for any sample in the tree. We can also see the time the request took to get this response along with response codes.

Apache JMeter HTTP Request Structure

Step 5:- Save the Test Plan and Run button or we can use Ctrl + R to run the test

Apache JMeter HTTP Request Results Tree

This will make request for the about page (https://google.com/about/) which we can see in the highlighted section of View Results Tree. If we set Path as blank or / then it will make request for (https://google.com/) only.

We can add multiple samplers in the same Test plan like if we want to access the home page and about page of google, just add (https://google.com/) in Server Name and / in Path of one HTTP Request and add (https://google.com/) in Server Name and /about in Path of another HTTP Request.

JMeter Tutorials: 

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.