Skip to main content

Command Palette

Search for a command to run...

How to Run JMeter Tests in Non-GUI Mode

Published
2 min read
How to Run JMeter Tests in Non-GUI Mode
G

As a Systems Engineer at Tata Consultancy Services, I deliver exceptional software products for mobile and web platforms, using agile methodologies and robust quality maintenance. I am experienced in performance testing, automation testing, API testing, and manual testing, with various tools and technologies such as Jmeter, Azure LoadTest, Selenium, Java, OOPS, Maven, TestNG, and Postman.

I have successfully developed and executed detailed test plans, test cases, and scripts for Android and web applications, ensuring high-quality standards and user satisfaction. I have also demonstrated my proficiency in manual REST API testing with Postman, as well as in end-to-end performance and automation testing using Jmeter and selenium with Java, TestNG and Maven. Additionally, I have utilized Azure DevOps for bug tracking and issue management.

Introduction

When we run a test in GUI mode, JMeter consumes additional system resources. That’s why, it is not advisable to use GUI mode for heavy load testing. GUI mode should be used only for recording, development, or debugging purposes.

On the other hand, when we run the test in non-GUI mode, we can utilize the maximum resources of the system by closing JMeter.

Load tests can be executed in non-GUI mode through the command prompt. Additionally, if we integrate JMeter with Jenkins, we can also run the tests using Jenkins.

How to Run the Test in Non-GUI Mode:

  • Open the 'bin' folder of JMeter in the command prompt

  • Create a test and save it in the 'bin' folder of JMeter

  • Execute the following command in the command prompt

      jmeter -n -t (location of jmeter test file) -l (location where you want to save the result)
    

    Here:

    • -n = Non-GUI mode

    • -t = location of the JMeter test file

    • -l = location where you want to save the result

  • In my case, the command will be:

      jmeter -n -t D:\JMeter\apache-jmeter-5.4.3\bin\Demo_PT.jmx -l D:\JMeter\apache-jmeter-5.4.3\Result\Demo_PT_result.csv
    
  • Press Enter

  • Once you press Enter, the execution will start. After successful execution, the test will stop, and you will see the result.

The result file will also be generated in the given path.

Conclusion

Running tests in non-GUI mode allows for efficient load testing. In this mode, JMeter doesn't need to be opened, making it a more efficient way of conducting load tests. This mode is recommended for actual load testing to ensure accurate and reliable results.

Tests can be executed in non-GUI mode with a simple command in the command prompt.

More from this blog

S

Software and Performance Testing Insights

462 posts

Results-Driven Agile QA Specialist | Expert in Mobile & Web Testing | Proficient in Test Planning, Execution, and Root Cause Analysis.