JMeter Load Testing : Part 1 — Installing JMeter on Windows
I recently had to run some performance load tests against a number of API apps to make sure they can handle the predicted load and identify the point at which performance degraded and the app needed to scale out. JMeter is a pretty impressive tool that can generate a rich set of reports for analysis and is very simple to configure and run if you come from an IT background.
What is JMeter?
JMeter is an open source load testing software tool from the Apache Software Foundation that runs on Java and is designed to load test web applications & APIs. It’s first official release was in December of 1998, so its a fairly well used, scrutinized & reputed tool for load testing.
Make sure you have installed the latest java sdk and set the PATH & JAVA_HOME environment variables.
- Installation instructions for Java : https://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/
- Setting the PATH variable : https://www.java.com/en/download/help/path.html
Example : If you have installed JDK in C:\Program Files\Java\jdk-12.0.2\ then your variables should look like :
- Path : C:\Program Files\Java\jdk-12.0.2\bin
- JAVA_HOME : C:\Program Files\Java\jdk-12.0.2
Verify that Java is now running by opening the command prompt and executing the following commands :
$ java --version$ javac
If these commands display the version information and javac usage information then you are good to go!
Download and Run JMeter
To download JMeter go to the official Apache JMeter site at :
Click on the apache-jmeter-5.3_src.zip link under the Binaries section. This should trigger the download of the zip file. Once the zip is downloaded, go to your downloads and extract the contents of the zip file.
Once extracted, change directory to your \bin folder, locate and run the jmeter.bat file by double-clicking on it.
JMeter UI should then start and provide you with an empty test plan
Lets now download the JMeter Plugins Manager. This will provide you with an easy way to install some of the reporting listeners we will be using later when we create performance tests. To do this, navigate to :
Click on the link to download plugins-manager.jar
Once downloaded, move it to the \apache-jmeter-5.3\lib\ext folder, and restart JMeter. You should now be able to see a new icon at the top right corner of JMeter UI. Clicking on this will open up the plugins manager for JMeter.
Open plugins manager, and add the following Graphs to JMeter :
- 3 Basic Graphs
After selecting 3 Basic Graphs click on Apply Changes and Restart JMeter.
Launching Jmeter from CMD
To launch JMeter from the command line :
- Right-click on This PC -> Select Properties -> Advanced system settings
- Click on Environment Variables. This should open up the Environment Variables dialog.
- Under the System Variables section, locate the Path variable. Select Edit…
- Select New -> and past the path to your JMeter bin directory. Ex : C:\Users\UserA\Downloads\apache-jmeter-5.3\apache-jmeter-5.3\bin
- Click Ok & Save/Apply
You can now open up the cmd prompt and run JMeter from anywhere using the following command :
You have now successfully installed JMeter on your Windows machine and can begin writing Load Tests which I will cover in subsequent parts of this series.