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:
- If the thread count is increased after a certain limit then JMeter crashes in GUI mode.
- 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.
- 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
Script file name: samplescript.jmx
Once above command is executed then .jtl file is generated inside JMeter bin folder.
Result file name: testresults.jtl