Skip to main content

How to Setup and Configure JMeter in Windows

JMeter is one of most popular performance testing tool and since it is open-source, therefore it is often a start point for beginners in performance testing. In this blog, I will share a step-by-step guide that can be used to install JMeter in Windows environment. There will also be some configuration and script designing tips which you will find useful while working on real-time JMeter projects.


1- Setup and Verify Java


Apache JMeter is purely a Java based tool; therefore first of all we need to make sure that Java is properly installed and configured in our system. If you are already using any java based applications, then Java might already be installed on your system. To check if Java is already installed open command prompt and run command java -version.

If Java is successfully installed and configured then the command will return valid java version number (java version “x.x.x.x”) as shown in image below:



If Java is not installed or configured, then you may get a message like this: "java" is not recognized as an internal or external command, operable program or batch file.



To fix it, you need to download and install valid java JRE or JDK corresponding to your operating system. Java JRE or JDK can be download from Java Download Page on Oracle website. After successful installation of JRE/JDK, open command prompt again and run the command java -version . It should now return java version number that you installed. If you still do not get the valid response after above steps, then you may look into setting java environment variables under windows system properties.

It is very important to have correct version of java on your system to get maximum out of JMeter. For example, using a 32 bit java on a 64 bit operating system can lead to under-utilization of resources. 



2- Download and Install JMeter


To download JMeter simply go to official Apache JMeter website and download the zip or tgz package.

Apache JMeter Download


After downloading the file, just unzip it anywhere in your system. In the unzipped folder there are all the files which JMeter requires for its functioning.



3- Configure JMeter for better performance


There are many ways to optimize JMeter for better performance. It is a complete topic in itself but for starter, I will recommend at least configuring java xms and xmx values in JMeter.bat file. By doing so, you can make sure that JMeter is properly using the available memory resources. It also reduces the chances of Out Of Memory errors.

To change these settings, open jmeter.bat file in notepad and update following lines





Other than this configuration, it is also important to use listeners intelligently in your test plan. Listeners that consume more memory like Table, Tree, Assertion and Graph listeners should be avoided during actual load test execution. It is best to only generate JTL test results file during actual load tests and later that JTL file can be used to create different 
reports.


4- Launch JMeter & Execute JMeter scripts


There are multiple ways to start JMeter. We can start it in GUI mode by opening jmeter.bat file or we can simply run commands in CMD to execute jmeter scripts without opening it in GUI mode.

4.1) To open JMeter GUI, just navigate to apache-jmeter-3.0>bin directory and double-click ApacheJMeter.jar or jmeter.bat file.

Steps to launch JMeter GUI






It should open up JMeter in GUI mode as in image below:



4.2) As discussed earlier, JMeter consumes lot of system resources while running in GUI mode. Therefore, it is best to use it in command-line non-GUI mode while performing actual load tests. JMeter scripts can be executed from CMD by using command below:



jmeter -n -t myScript.jmx



There are other parameter as well which you can pass along with command like path to JTL results file, server IP and port number etc. Command prompt will show progress messages during the script execution and also a summary after successful execution of script.

Still facing any issues while setting up JMeter? Feel free to ask and I will try my best to help out.

Comments

  1. Sure, but please add my blog link into your content or anywhere, For more detail please click and view softwareqatestings.blogspot.com

    ReplyDelete

Post a Comment

Popular posts from this blog

A QA expert’s guide to 11 popular software testing tools

  Which tools should you use for your quality assurance (QA)? Here are 11 popular software testing tools we recommend. 1. Selenium A testing framework for web applications on platforms such as Linux, Mac, and Windows,  Selenium  is also used to test browser compatibility. Developers can test in a number of languages, such as Java, Groovy, PHP, Ruby, C#, Python, and Perl. Selenium is part of most major browsers, including Firefox and Chrome. 2. Jenkins Jenkins  is a  continuous integration  (CI) tool for testing codebase changes in real-time. Jenkins lets you detect and resolve codebase problems quickly and automate build testing. An open-source program, it was  forked  from the Hudson CI tool. Jenkins runs on servers in a container and supports version control tools such as Perforce, Git, and Subversion. 3. New Relic New Relic  is a SaaS product that allows you to monitor mobile and web apps in real-time. It offers deep analytics that can giv...

Testers are not the "Quality" officers in a Agile teams | Supreme Agile.

What makes a team really "Agile"? To me, an agile team is one that follows the simple values and principles of the Agile Manifesto but knows how to take them a step further. Although the Agile Manifesto created the foundations of all it’s frameworks (Scrum, EP, Lean Etc.), it’s still not a religion that the team should follow blindly. An Agile team should have the power to learn new things. They should combine artifacts that work great in other frameworks, innovate new development techniques and find the balance between an Agile Spirit and what is more practical that works for them. There is one thing an Agile team must follow and that is the simple mission that the customer is the most important stakeholder. Therefore the team should always focus on making on delivering the best possible product that meets the customer’s requirements. From my experience, if a team focuses on this single mission.  It will formulate a team that will deliver the best quality ...