A command-line interface (CLI) processes commands to a computer program in the form of lines of text. The program which handles the interface is called a command-line interpreter or command-line processor.
Operating systems implement a command-line interface in a shell for interactive access to operating system functions or services.
We are going to execute the JMeter Tests in Non-GUI mode. Before that, we need to understand why we need to Execute the Test In Non-GUI mode.
Normally when we execute the Request in the Non-GUI Mode, it will send some requests to the server and get the response, and again it will take some time to generate the reports and view in the results to the user. so it will do some kind of process in the UI Level.
So we can not get the Actual result when we send the request and getting a response through UI. To avoid that situation we run JMeter Test in command prompt.
The following example demonstrates how to run the JMeter in the Command-Line.
Jmeter -n -t (location of your JMeter test script) -l(location of the result file)
-n=Non GUI Mode
-t=Location of JMeter Script
-l=Location of result file
The Command is as shown below:
jmeter -n -t D:Jmeter_Projectapache-jmeter-5.2.1inMyPlanscommandline.jmx -l D:Jmeter_Projectapache-jmeter-5.2.1inMyPlans
esult.csv
Where:
//** the location of the Test Plan**//
D:Jmeter_Projectapache-jmeter-5.2.1inMyPlanscommandline.jmx
//**Result File*//
D:Jmeter_Projectapache-jmeter-5.2.1inMyPlans
esult.csv
Result.jtl.jmeter -n -t D:Jmeter_Projectapache-jmeter-5.2.1inMyPlanscommandline.jmx -l D:Jmeter_Projectapache-jmeter-5.2.1inMyPlans
esult.jtl
blazedemo link in the server and enter the path as /Registerjmeter -n -t "D:Jmeter_Projectapache-jmeter-5.2.1inMyPlanscommandline.jmx" -l "D:Jmeter_Projectapache-jmeter-5.2.1inMyPlans
esult.csv" -e -o "D:Jmeter_Projectapache-jmeter-5.2.1inMyPlanshtmlReports"
jmeter -g "D:Jmeter_Projectapache-jmeter-5.2.1inMyPlans
esult.csv" -o ""D:Jmeter_Projectapache-jmeter-5.2.1inMyPlanshtmlReports"
Result.csv file and then HTML Report.