Below mentioned command will run your jmx file and create results in csv and HTML format
jmeter -n -t “Demo.jmx” -l “DemoResult.csv” -e -o “DemoHtmlReport”
Let's understand the above command
- To run the above command you need to take the cmd to the directory in which JMeter is stored, and then navigate to bin directory where the jmeter.bat file is store. Then open cmd in this location and use the above command with some modification.
- -n → non-gui mode
- -t → Test plan file, when you execute some test plan from jMeter GUI it will create a jmx file , save that jmx file in the bin folder for now.
- “Demo.JMX” → Test plan that is created by JMeter UI.
- -l → JMeter Logs, this time it will create a CSV file
- -e -o are used to create HTML report from the same CSV file
For understanding first, try the below command it will run your JMX and also create a CSV file for the result, then remove the DemoResult.csv and again run with the previous command, it will create an HTML report.
jmeter -n -t “Demo.jmx” -l “DemoResult.csv”