2019 / 8 / 12
Apache JMeter is an Open Source Software, a pure 100% Java Application developed for load testing and Performance Testing. For those who are new to JMeter, here is a step by step guide on How to Install JMeter and How to run JMeter in different Modes.
Since JMeter is a 100% pure Java Application, One of the main prerequisites is JVM 6 or Higher. You can download and install the latest version of the Java SE Development Kit here.
After installation is completed, you can follow the following procedure to check whether Java JDK is successfully installed in your system-
1. In Windows/ Linux, Open the Terminal.
2. Enter the command java-version.
If Java JDK is successfully installed, you will see the following output screen:
If nothing displays, Please follow the step by step installation guide from Java Platform, Standard Edition Installation Guide.
After successful installation of Java JDK, the next step is to download the Apache JMeter Binaries here. Choose either zip/tgz file from the Binaries as shown in the figure below-
JMeter Installation is very easy. All you need to do is to unzip the zip/tgz file to the desired directory. There are no tedious steps to be followed, Just Unzip and You are ready to go!
Once Unzip is done, the Installation Directory structure looks like this-
Before proceeding further we will have a brief discussion about the important components in the directory structure.
1. /bin: This directory contains script files for starting JMeter
2. /docs: Directory consists of JMeter Documentation Files.
3. /extras: Directory consists of ant related extra files.
4. /lib: Contains the required Java Library for JMeter.
5. /lib/ext: This Directory consists of core jar files for JMeter and Protocols.
JMeter can be launched in 3 ways, each mode catering a special requirement.
Command Line Mode
But do we really need these many modes or a single-mode can cater to all the scenarios? The answer is YES!!! We cannot use JMeter GUI Mode to perform Load testing. For this, we need less power consuming Command Line Mode. Similarly in a Distributed environment where there is Client-Server Architecture we need a special mode for the Server System.
So in a nutshell, a Single running mode for JMeter is not sufficed to handle all the environments.
Let’s begin with a detailed discussion of Modes. This will help you to gain insight into why different modes are required.
If you are using Windows, navigate to the bin folder in the installed directory. You will find a Windows Batch File under the name jmeter.bat
Just execute this Batch File and You will see the Apache JMeter Windows.
Server Mode is designed for Distributed Testing Environment like a Client-Server Model, where Apache JMeter will run in Server Mode on Server Computer and in GUI Mode on Client Computer.
To start JMeter in Server Mode, just execute the Windows Batch File jmeter-server.bat in the bin directory.
Command Line Mode:
Running JMeter in GUI Mode consumes a lot of computer memory. This is why it is not advisable to run JMeter in GUI Mode for Load Testing.
For saving resources, you may choose to execute JMeter in Command Line Mode.
jmeter -n -t SampleTest.jmx -l testlog.jtl
-n: Specifies JMeter to run in Non-GUI Mode.
-t: Specifies the name of JMX File containing the test plan.
-l: Specifies the name of JTL file to log test results.
Once your test is complete, you can see the log file using the GUI Mode.
After having such a long discussion on JMeter, now you guys are ready to start installing JMeter and try running it in various modes.
Keep your system ready with JMeter, as in the next article we will be focusing on how to generate a Test Plan with the help of step by step visuals.