If you want to start Apache JMeter in non-GUI mode, use the following command line options:
- -n – non-GUI mode – this specifies JMeter is to run in non-GUI mode
- -t – JMX file – location of the test plan and the name of JMX file that contains the Test Plan
- -l – log file name of JTL file to log sample results to
Example
jmeter -n -t my_test_plan.jmx -l log.jtl
Optional
- -j – name of JMeter run log file
- -r – Run the test in the servers specified by the JMeter property “remote_hosts”
- -R – list of remote servers Run the test in the specified remote servers
- -H – proxy server hostname or ip address
- -P – proxy server port
Example
jmeter -n -t my_test_plan.jmx -l log.jtl -H my.proxy.server -P 8000
Tips for running JMeter in non-GUI mode:
- here are details on how to add jmeter to the PATH variable of your environment
- remove any listeners that are GUI mode specific (you can do this by opening your JMX file in GUI mode and remove the GUI specific listeners)
- get summary results in the terminal by activating the summary option in the jmeter.properties file
Additional scripts that come with Apache JMeter installation can be found in the /bin folder where you’ve downloaded JMeter.
Is Your Infrastructure Ready for Global Traffic Spikes?
Unexpected load surges can disrupt your services. With LoadFocus’s cutting-edge Load Testing solutions, simulate real-world traffic from multiple global locations in a single test. Our advanced engine dynamically upscales and downscales virtual users in real time, delivering comprehensive reports that empower you to identify and resolve performance bottlenecks before they affect your users.
For Windows systems:
- jmeter-n.cmd – drop a JMX file on this to run a non-GUI test
- jmeter-n-r.cmd – drop a JMX file on this to run a non-GUI test remotely
- mirror-server.cmd – runs the JMeter Mirror Server in non-GUI mode
- shutdown.cmd – Run the Shutdown client to stop a non-GUI instance gracefully
- stoptest.cmd – Run the Shutdown client to stop a non-GUI instance abruptly
For Unix/Linux systems:
- mirror-server.sh – runs the JMeter Mirror Server in non-GUI mode
- shutdown.sh – Run the Shutdown client to stop a non-GUI instance gracefully
- stoptest.sh – Run the Shutdown client to stop a non-GUI instance abruptly
The commands will only be accepted if the scripts are run from the same host. Details on how to start JMeter on Mac system can be found here. Also, here is how to load test a website with Apache JMeter.