<img alt="" src="https://secure.leadforensics.com/150446.png " style="display:none;">

How to run JMeter in Non GUI mode

Kishore Bhamare Feb 03, 2015

JMeter in Non GUI mode JMeter Technology

Apache JMeter is an open source testing tool. JMeter functions to analyze and measure the performance of web applications with a variety of other services. The GUI mode of JMeter is perfect for adding and editing new configuration elements, thread groups, and samplers as a result of which you can view a number of different listeners helping for debugging.

However, the GUI mode does have a limitation which slows down the CPU utilization while running the recorded script. If we are running multiple listeners in a script, it affects the JMeter performance. To overcome such a situation, the script should be run in the non-GUI mode. There is a benefit to drive more requests per second out of JMeter in non-GUI mode.

Why to use JMeter in Non GUI/command line mode:

  • Increasing threads (after certain limit) due to which JMeter crashes in the GUI mode.
  • For heavy test scenarios (ex: shopping application: login-view product-add to cart-view bill-remove product-pay bill) JMeter consumes memory and CPU and it may affect your test results.
  • To increase JMeter capabilities, i.e. to get more requests per second.

Running JMeter in command line mode:

Running JMeter using command line in non-GUI mode is very simple.

  1. Open command prompt
  2. Go into JMeter’s bin folder
  3. Enter following command, jmeter -n –t test.jmx -l testresults.jtl

Running JMeter using command line

jmeter -n –t test.jmx -l testresults.jtl

-n: It specifies JMeter is to run in non-gui mode
-t: Name of JMX file that contains the Test Plan
-l: Name of JTL(JMeter text logs) file to log results
-j: Name of JMeter run log file

Other than these options, JMeter has several other parameters that can be used for running in the non-GUI mode.

-R: list of remote servers,

-H: proxy server hostname or ip address
-P: proxy server port

View test result:
Once your test is complete, you will see the following display:

View test result

After completing the test, a JTL file will be generated at jmeter2.12/bin folder

Follow below steps to view test results from the resultant JTL file.

  • Open JMeter in GUI mode.
  • Add any listener Eg. View Results Tree.
  • Click Browse button of the file name field in listener.
  • Open testresult.jtl file.
  • You should be able to see the result in listener now.

Would love to address questions from the readers. Kindly post them in the comments section below.

Similar Blog

e-Zest is a leading digital innovation partner for enterprises and technology companies that utilizes emerging technologies for creating engaging customers experiences. Being a customer-focused and technology-driven company, it always helps clients in crafting holistic business value for their software development efforts. It offers software development and consulting services for cloud computing, enterprise mobility, big data and analytics, user experience and digital commerce.