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 How to run JMeter in Non GUI mode

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 How to run JMeter in Non GUI mode

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.

By |February 3rd, 2015|Technology|0 Comments

About the Author:

 How to run JMeter in Non GUI mode
Kishore works as a Software Test Engineer at e-Zest. His expertise lies in performance testing and he has spent close to 4 years in this field. While he is extremely passionate about performance testing and automation testing, his other hobbies include listening to music, travelling and wildlife photography.

Recommended article: Chomsky: We Are All – Fill in the Blank.
This entry passed through the Full-Text RSS service – if this is your content and you’re reading it on someone else’s site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers.

e-Zest | India | USA | UK | Germany | Europe