I've been using JMeter for quite some time now to monitor how the products we're developing perform under load, but I never really had the need to generate reports. Well that changed last week, when a customer was asking for load tests on a product we're shipping.
It turns out — it's super straight forward — you have two main options:
- Execute test and generate report
- Generate report from the
.csvfile created by the test
To execute the commands, open up a command prompt and navigate to the
/bin folder of your JMeter installation.
Execute test and generate a HTML report
To generate the HTML report while executing the test, use the following command
jmeter -n -t <PATH_TO_JMX_FILE> -l <PATH_WHERE_CSV_IS_GENERATED> -e -o <PATH_WHERE_HTML_REPORT_IS_GENERATED>
You have to make sure that the
.jmx file you're pointing to is valid; and IF the
.csv file, or the directory where the HTML report will be generated already exist, they must be empty.
Generate HTML report from existing
If you already have the .csv file containing the test results, all you need to do is execute the command below to generate the HTML report from it
jmeter -g <PATH_TO_CSV_FILE> -o <PATH_WHERE_HTML_REPORT_IS_GENERATED>