问题
These are the steps that I followed to generate reports:
- I have the
.jtl
file - I copy paste given sample configuration to my
user.properties
file located atapache-jmeter-5.0\bin
I convert
.jtl
to aggregate report usingCMDRunner.jar
java -jar CMDRunner.jar --tool Reporter --generate-csv Demo17Results.csv --input-jtl Demo17Results.jtl --plugin-type AggregateReport
Convert
csv
file got from step#3 to HTML reportsI tried (1)
jmeter -g Demo17Results.csv -o htmlReports/
Error: csv' does not contain the field names header, ensure the jmeter.save.saveservice.* properties are the same as when the CSV file was created or the file may be read incorrectly when generating report
An error occurred: Mismatch between expected number of columns:17 and columns in CSV file:11, check your jmeter.save.saveservice.* configuration or check line is complete
I tried (2) jmeter -n -t Demo17Run.jmx -l Demo17Results.csv -e -o htmlReports/
Creating summariser <summary>
Error in NonGUIDriver java.lang.IllegalArgumentException: Results file:Demo17Results.csv is not empty
after emptying the csv file
Creating summariser <summary>
Created the tree successfully using Demo17Run.jmx
Starting the test
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
summary = 0 in 00:00:00 = ******/s Avg: 0 Min: 9223372036854775807 Max: -9223372036854775808 Err: 0 (0.00%)
Tidying up ...
Error generating the report: org.apache.jmeter.report.core.SampleException: Could not read metadata !
... end of run
What am I doing wrong to generate Jmeter HTML dashboard reports?
回答1:
- You don't need step 2, JMeter default configuration is just fine for dashboard generation
- You don't need step 3, the dashboard needs to be created from the
Demo17Results.jtl
file which contains full raw results, not statistics table Try re-running your test scenario with forcing deletion of the previous result file via -f argument:
jmeter -n -f -t Demo17Run.jmx -l Demo17Results.jtl -e -o htmlReports/
If nothing helps double check you have not modified required results file configuration settings and increase JMeter logs verbosity for report.dashboard package by adding the next line to log4j2.xml file:
<Logger name="org.apache.jmeter.report.dashboard" level="debug" />
来源:https://stackoverflow.com/questions/52862281/jmeter-html-report-generation-after-tests