Jmeter: HTML report generation after tests

旧巷老猫 提交于 2019-12-24 08:30:31

问题


These are the steps that I followed to generate reports:

  1. I have the .jtl file
  2. I copy paste given sample configuration to my user.properties file located at apache-jmeter-5.0\bin
  3. I convert .jtl to aggregate report using CMDRunner.jar

    java -jar CMDRunner.jar --tool Reporter --generate-csv Demo17Results.csv --input-jtl Demo17Results.jtl --plugin-type AggregateReport
    
  4. Convert csv file got from step#3 to HTML reports

    I 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:


  1. You don't need step 2, JMeter default configuration is just fine for dashboard generation
  2. 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
  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!