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.
Related Article: JMeter with Selenium: A Comprehensive Guide to Performance Testing
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
Step-2: Now, add the listener to Thread Group & execute the test
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
After executing the command it starts running the test & log the results into Demo.csv log file.
On the basis of the observance it has been seen that, it logs all 10 users’ details as we check it with the use of Jmeter. We can use multiple users to check the load-timings & can request for more details. And we hope, this blog helps you to expand your core-JMeter-knowledge. Get in touch with our experts now!