Home > Automation Testing > How to use Non GUI mode in JMeter

How to use Non GUI mode in JMeter

JMeter provides simple and user friendly GUI to users. Using the JMeter GUI mode user can use elements like Thread Group, samplers, Processors, Controllers, Timers etc. JMeter GUI mode also gives the facility to view and analyze the result of the script using different types of Listeners.
Apart from the above facilities JMeter GUI mode has following disadvantages:

  1. If the thread count is increased after a certain limit then JMeter crashes in GUI mode.
  2. If Test plan contains complex test scenarios which has large number of Test steps and operations then JMeter GUI mode consumes large amount of CPU power and memory which eventually affects the test results.
  3. If more number of Listeners are added to the Test plan this also leads to slow down of system.

To avoid above issues JMeter scripts can be executed in Non GUI mode.
Syntax to run JMeter in Non GUI mode: jmeter -n -t scriptname.jmx -l resultfilename.jtl​
Decoding the syntax:

  • – n tells Jmeter to run the script in Non GUI mode​
  • – t means name of the Jmeter file to run​
  • – l means name of the file to log results of the script​
  • jtl it is an extension whose full form is Jmeter text logs​

Example: In the below example we will execute samplescript.jmx file. Below is the command:

jmeter -n -t samplescript.jmx -l testresults.jtl​

Image: non GUI mode

Script file name: samplescript.jmx
Once above command is executed then .jtl file is generated inside JMeter bin folder.
Result file name: testresults.jtl

This Article is TAGGED in , . BOOKMARK THE permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">