Easy Way To Run JMeter From Command Line In Non GUI Mode

JMeter from Command Line

In my Previous blog, I give you the steps for how to check HTTP request using Jmeter. Now, this blog is to check, how can we check JMeter test or script using Command line.
  
Why Do we exactly go to non-GUI mode? Why Execute non-GUI mode?

GUI consumes many Resources / Memory.
GUI is not recommending for heavy Load testing for a page.
Command line can be integrated with other systems also

Command line for the execution of the performance test is very handy to have. Let us begin the process of running the performance test using a command line.

Step-1: Add the test to check the HTTP request.

Check HTTP Request

Step-2: Now, add the listener to Thread Group & execute the test.

listener to Thread Group

Shows the Results of the response to the request for 10 users.

Now, We check how to Test the request using the command line. Remove the View Results in Table listener from HTTP request test & save the test. After Saving the test closes the Jmeter.

 

Create one blank .csv file & save it. Go to Command line, Go to the JMeter Bin folder. The command to execute the JMeter test you have to right below command in command line.

For mac: Sh Jmeter -n -t [Location of your test script] -l [Location of the result file]

If you are using any other OS you can simply remove ‘sh’ before the command.

 

Where,

-n: Is for use when we executing the file in non-GUI mode.

-t: Location of your JMeter test script.

-l: Is for the location of the result file where you want to log all the results.

Now, execute the Command:

sh jmeter -n -t /Users/mac35/Downloads/Nitroshare/apache-jmeter-3.0/bin/ViewresultComandline.jmx -l /Users/mac35/Downloads/NitroShare/apache-jmeter-3.0/bin/Demo.csv

 

Execute The Command
  • After executing the command it starts running the test & log the results into Demo.csv log file.
Executing Command

You can see it logs all 10 users details as we check with the use of Jmeter. We can use multiple users to check the load timings & for more request details. Need more assistance regarding Web Development Service then contact us now.

 

I hope this blog helps you to expand your JMeter knowledge … Thanks!