How to install APACHE JMeter and hit HTTP API in JMeter?

Vikas Kohli
4 min readApr 3, 2023

--

Install JMeter using Brew

I will install the Jmeter in the mac OS by using the brew command. If the brew is not installed on the mac then it can be installed using the curl command. For reference pls find the link below

Install Brew on MAC

After Installing brew, go to the terminal, type the below command

 brew install jmeter

To check the JMeter Version, type the below command

jmeter --version
JMeter Version 5.5

The JMeter will be installed in the homebrew directory and now we have to run the script file for the same

#Go To Directory Path
cd /opt/homebrew/Cellar/jmeter/5.5/bin

#Run the script file
sh jmeter

The above script will launch the JMeter Application

JMeter

After launching the JMeter Application, now we need to run the HTTP/HTTPS request, but for that, we need to create the plan, we can choose any name by default its “Test Plan”. After that, we will add the thread and select the thread group

Add Thread for Plan in JMeter

After selecting the above, It asks to name the thread group and also its properties

  1. No of Threads(Users) by default its 1 means how many users are using that request
  2. Ramp-Up Period (in seconds) — the difference between the threads
  3. Loop Count — total number of hits hit by the user
Thread Properties

Now we will add the HTTP Request in the thread which we just created

Add HTTP Request

After selecting the HTTP request it will ask for some properties of the request like URL, parameters, etc.

HTTP Request Basic Options

In the above firstly we define the protocol and then the server/ip and if any port number we’re using then we can mention that and then select the HTTP method.

Consider we have the following URL-

URL https://imvikaskohli.medium.com/my-stories?page=1

Protocol - https
Server - imvikaskohli.medium.com
Path - /my-stories
Http Method - Get
Parameters - page is the key with value 1

It can happen that we need to add the HTTP header too like for authorization or something else to send the HTTP request. For that, we need to add that as well. Click on the HTTP request that we just added, go to Config Element, and then select the HTTP Header Manager

HTTP Request Configuration

After that, we can add the header parameters that will be sent along with the HTTP request.

HTTP Header Manager

Also, we need to see results for that we’ll attach a listener to it and if we need the total summary we can add that too.

Click on the thread that we created then go to the listener and then select the View Result Tree

For Summary, select the summary report

Jmeter Thread Listener

After that click on the save button or Cmd + S to save. To run click on the first green color button it will run the thread

Thread Save and Run

After the run we can view the results in the View Result Tree and Their summary inside the Summary Report

View Result Tree
Summary Report

Hope this helps in running the HTTP Request in the JMeter

Increase the iterations for load Testing

Happy Testing 😊

--

--

Vikas Kohli
Vikas Kohli

Written by Vikas Kohli

B.E Software Developer, Enthusiastic, Ego-surfing

No responses yet