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:
- Go to “Start”
- Search “Run” Or Press “Win+r”
- Navigate to ‘bin’ folder of JMeter using “cd” command
- Type the command:
jmeter -n -t <jmx file name with path> -l <log file name with path>
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>
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:
- Navigate to ‘bin’ folder of JMeter using “cd” command
- 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:
- Performance Testing Tutorial
- Performance Engineering Tutorial
- Micro Focus LoadRunner Tutorial
- NeoLoad Tutorial
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*
good day,
I got this error above, kindly help me out.
Regards,
Noni
Hi Noni,
Please remove the space from folder path. A path should not contain any whitespace.
How to connect database and run update sql query in .jmx file using Non gui mode
Hi Poorna,
You need to create a test script with JDBC elements available in the JMeter. Refer this post for more information.
https://jmeter.apache.org/usermanual/build-db-test-plan.html
Good Job