JMeter Non-GUI mode

Non-GUI mode is recommended as a test execution mode in JMeter. The reason is that JMeter consumes less memory in Non-GUI mode which helps to accommodate more threads on a load generator. Non-GUI mode provides more space for threads and prevents the failure of the test due to out of memory issue.

Following are the steps to execute the test in Non-GUI mode of JMeter:

For Windows:

  1. Go to “Start”
  2. Search “Run” Or Press “Win+r”
  3. Navigate to ‘bin’ folder of JMeter using “cd” command
  4. Type the command:

jmeter -n -t <jmx file name with path> -l <log file name with path>

JMeter Non GUI Mode Windows
Figure 01: Non GUI Mode Test Execution in Windows

Windows’ command to generate an HTML report after the completion of the test:

jmeter -n -t <jmx file name with path> -l <log file name with path> -e -o <path of folder to save HTML report>

JMeter Non GUI Mode Test Execution with HTML Report in Windows
Figure 02: Non GUI Mode Test Execution with HTML Report in Windows

There are some useful commands for Windows OS:

  • jmeter.bat: To run JMeter (in GUI mode by default)
  • jmeterw.cmd: To run JMeter without the windows shell console (in GUI mode by default)
  • jmeter-n.cmd: To drop a JMX file on this to run a non-GUI test
  • jmeter-n-r.cmd: To drop a JMX file on this to run a non-GUI test remotely
  • jmeter-t.cmd: To drop a JMX file on this to load it in GUI mode
  • jmeter-server.bat: To start JMeter in the server mode
  • mirror-server.cmd: To run the JMeter Mirror Server in non-GUI mode
  • shutdown.cmd: To run the Shutdown client to stop a non-GUI instance gracefully
  • stoptest.cmd: To run the Shutdown client to stop a non-GUI instance abruptly
  • jmeter -?: To print a list of all the command-line options of Non-GUI mode.

For Unix:

  1. Navigate to ‘bin’ folder of JMeter using “cd” command
  2. Type the command:

./jmeter.sh -n -t <jmx file name with path> -l <log file name with path>

Unix’s command to generate an HTML report after the completion of the test:

./jmeter.sh -n -t <jmx file name with path> -l <log file name with path> -e -o <path of folder to save HTML report>

Additional Information: If you want to stop a test in the middle then navigate to ‘bin’ folder of JMeter and use stoptest command (for Windows) or use ./stoptest.sh command (for Unix).


You may be interested:


6 thoughts on “JMeter Non-GUI mode”

  1. C:\Users\nonhlanhla.hlatshway\Downloads\apache-jmeter-5.2.1 (2)\apache-jmeter-5.2.1\bin>jmeter -n -t C:\Users\nonhlanhla.hlatshway\Downloads\apache-jmeter-5.2.1 (2)\apache-jmeter-5.2.1\bin\Jmeterprojects\RecordingDemo\Login-on-Intranet.jmx -l cd C:\Users\nonhlanhla.hlatshway\Downloads\apache-jmeter-5.2.1 (2)\apache-jmeter-5.2.1\bin\Jmeterprojects\RecordingDemo\Result\Result.csv -e -o cd C:\Users\nonhlanhla.hlatshway\Downloads\apache-jmeter-5.2.1 (2)\apache-jmeter-5.2.1\bin\Jmeterprojects\RecordingDemo\HTML Reports
    *An error occurred: Unknown arg: (2)\apache-jmeter-5.2.1\bin\Jmeterprojects\RecordingDemo\Login-on-Intranet.jmx
    errorlevel=1*

Comments are closed.