Apache JMeter
Apache JMeter is an open source software application; a Java application designed to load test functional behavior and calculate performance. It is primarily used for web applications testing, but it has other test features.
What Apache JMeter can do
Apache JMeter is used mostly for load testing and performance testing for Web applications. It can generate or simulate load on different parts of applications like web servers, any resources, networks etc.
Apache JMeter features include:
- Ability to load and performance test many different applications/server/protocol types:
- Web - HTTP, HTTPS (Java, NodeJS, PHP, ASP.NET, …)
- SOAP / REST Web Services
- FTP
- Database via JDBC
- LDAP
- Message-oriented middleware (MOM) via JMS
- Mail - SMTP(S), POP3(S) and IMAP(S)
- Native commands or shell scripts
- TCP
- Java Objects
- Full featured Test IDE that allows fast Test Plan recording (from Browsers or native applications), building and debugging.
- CLI mode (Command-line mode (previously called Non-GUI) / headless mode) to load test from any Java compatible OS (Linux, Windows, Mac OSX, …)
- A complete and ready to present dynamic HTML report
- Easy correlation through ability to extract data from most popular response formats, HTML, JSON, XML or any textual format
- Complete portability and 100% Java purity.
- Full multithreading framework allows concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups.
- Caching and offline analysis/replaying of test results.
- Highly Extensible core:
- Pluggable Samplers allow unlimited testing capabilities.
- Scriptable Samplers (JSR223-compatible languages like Groovy and Bean Shell)
- Several load statistics may be chosen with pluggable timers.
- Data analysis and visualization plugins allow great extensibility as well as personalization.
- Functions can be used to provide dynamic input to a test or provide data manipulation.
- Easy Continuous Integration through 3rd party Open Source libraries for Maven, Gradle and Jenkins.
Prerequisite before installing Apache JMeter
Apache JMeter specifies that certain minimum requirements be met in your computing environment for Apache JMeter setup. It requires Java 8 or higher. Java Runtime (JRE) is enough to run it but if you have JDK installed in your machine as for recording of HTTPS, JMeter needs key tool utility from JDK. This is the prerequisite before going in the details on how to install Apache JMeter on Windows.
Check if you have already Java Installed
Open your command prompt
Run the command
java -version
If you receive ‘java’ is not recognized then you either do not have Java installed or it is not correctly configured.
If you have correctly installed and configured JRE, then it should show a similar to below message.
Installing Java
If you do not have Java installed, then follow the steps below:
- Go to https://www.java.com/
- It should be like below after accepting any prompt of accepting cookie usage.
- Click on “Java Download”
- Download the appropriate executable setup file according to your machine’s operating system
- Run the executable setup file and follow the installation instruction.
Once it is successfully installed, check again the command java -version if it is running successfully, if not then you need to manually configure JAVA_HOME environment variable.
How to configure JAVA_HOME Path
- First copy the java installation path based on your version of Java
For jdk: in general, it is “C:\Program Files\Java\jdk-15.0.1”
For jre: in general, it is “C:\Program Files\Java\jre1.8.0_271” - Open Environment variable section from System properties.
- Right click on “My Computer” go to properties
- Go to Advanced System settings
- In “Advanced” tab you will be seeing “Environment Variables” button
- Press “New” under “System variables” section
Variable name: JAVA_HOME
Variable value: C:\Program Files\Java\jdk-15.0.1 - Then select “Path” variable and go to edit and at the end of the string add ;%JAVA_HOME%/bin
Careful here do not remove anything else.
Till this point, you must make sure, java -version command is working as expected, then ahead with the rest of the instruction of installing Apache JMeter.
Download Apache JMeter and Installing JMeter
Now that you have all the prerequisites installed and ready before installing JMeter and you can move to the part of how to install Apache JMeter on Windows.
- Go to https://jmeter.apache.org/download_jmeter.cgi
- Download the binaries. I prefer the zip format in Windows.
- Unzip or Extract it to the location where you want to keep JMeter.
Great! Now that we have successfully downloaded and unzipped JMeter. You should see the following files within the apache-jmeter-xx folder, you can go through all this JMeter setup files there.:
backups: contains the backups of JMX files (also known as JMeter projects) you edited within JMeter,
bin: contains the executable files to launch JMeter, and configuration files to tweak JMeter settings or JMeter setup information,
docs: JMeter’s documentation in HTML format,
extras: some useful side tools like excel sheets to compute graphs from JTL result files,
lib: JMeter’s libraries which are mostly Java JAR files,
printable_docs: documentation in printable format.
It’s now time to see how to launch JMeter.
Launch JMeter
- Go to bin/ folder by double-clicking on it
- Double-click on jmeter.bat to run it in Windows,
- It should open both a command-line terminal and JMeter’s UI. Below is how it looks in black theme.
Now that you have JMeter installed successfully, you can use Apache JMeter for performance testing or load testing.
- 155 reads