JMeter - 测试报告始终采用 XML 格式,即使 jmeter.save.saveservice.output_format 在所有地方都设置为 CSV

JMeter - tests report always in XML format even though jmeter.save.saveservice.output_format is set to CSV in all places

我将正确的 属性 设置为 csv 格式,但我的报告仍然给我 XML。为什么会这样?

当我想绘制图表时:

jmeter -g foo.csv -o graphs

我看到错误:

File '/xxx/xxx/foo.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: Could not read sample <0>

在GUI模式下用Jmeter打开jmx文件,select结果的所有监听器,例如“View results in tree”或“View results in table”,然后点击“Configure”按钮,检查您是否选中了“将输出另存为 XML”和“保存响应数据”检查。即使一个听众检查它,最终报告也会在 XML 中,即使您设置了正确的 属性.

或者,您可以在文本编辑器中打开 jmx 文件,搜索 <responseData><xml>。标签的内容应该是falsefalse,总是。

属性 需要在 运行 测试 之前设置 ,而不是在生成结果之前设置。

也不要使用任何监听器,它们不会增加价值,只是 consume resources. If you run JMeter in command-line non-GUI mode 比如:

jmeter -n -t test.jmx -l foo.csv 

foo.csv 应该是 CSV 格式(假设默认 Results File Configuration

如果您无法重新运行 测试,您可以使用Merge Results tool for converting it from the XML format to CSV format, the Merge Results Tool can be installed using JMeter Plugins Manager