How to Run JMeter Tests in Non-GUI Mode

How to Run JMeter Tests in Non-GUI Mode

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.

Did you find this article valuable?

Support Perf Insights by becoming a sponsor. Any amount is appreciated!