Jmeter 3.0 无法生成 ANT HTML 报告 [英] Jmeter 3.0 can't generate the ANT HTML report
问题描述
我快要拔掉所有头发了,请有人帮帮我..
I am on the verge of pulling all my hair out, someone please help me..
我正在使用 JMeter 3.0 并尝试从我的 jtl 文件生成仪表板报告,但出现错误 -
I am using JMeter 3.0 and am trying to generate the dashboard report from my jtl files, but I get the error -
result.jtl' 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
我的 user.properites 文件包含 -
my user.properites file contains -
jmeter.save.saveservice.output_format=csv
jmeter.save.saveservice.bytes=true
jmeter.save.saveservice.label=true
jmeter.save.saveservice.latency=true
jmeter.save.saveservice.response_code=true
jmeter.save.saveservice.response_message=true
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.thread_counts=true
jmeter.save.saveservice.thread_name=true
jmeter.save.saveservice.time=true
jmeter.save.saveservice.timestamp_format=ms
jmeter.save.saveservice.timestamp_format=yyyy-MM-dd HH:mm:ss
jmeter.save.saveservice.print_field_names=true
这些值在 jmeter.properties 文件中也是相同的,只是为了确保我没有丢失任何东西......
these values are the same in the jmeter.properties file as well, just to ensure I haven't lost anything...
我真的不明白为什么我不能让 jtl 包含标题,我已经遵循了我能找到的每一个指南,而且我似乎做得对..
I really can't work out why I can't get the jtl to include the headers, I have followed every guide I can find, and I seem to be doing it right..
有人可以指出我缺少什么吗,或者包含一个他们的 jmeter 的压缩版本,我可以尝试将我的 ant 项目指向它?
Can someone point to me what I am missing, or include a zipped version of their jmeter with it all working that I can try and point my ant project to?
希望有人能帮忙.
推荐答案
仔细检查 build.xml 文件的
部分.默认 JMeter Ant Task 假定 .jtl 结果文件采用 XML 输出格式,因此如果您有以下行:
Double check <jmeter>
section of your build.xml file. Default JMeter Ant Task assumes XML out put format for .jtl result files so if you have the following line:
<property name="jmeter.save.saveservice.output_format" value="xml"/>
只需将其注释掉或删除它,您的问题就会得到解决.
just comment it out or delete it and your issue should be resolved.
我不认为 JMeter Ant Task 通过 user.properties 文件尊重覆盖,最好使用 jmeterproperties 属性或在 Ant 构建中明确指定相关配置文件如:
I don't think JMeter Ant Task respects overrides via user.properties file, it is better to use jmeterproperties attribute or explicitly specify the relevant configuration in the Ant build file like:
<target name="test">
<jmeter
jmeterhome="${jmeter.home}"
testplan ="${testpath}/${test}.jmx"
resultlog="${testpath}/${test}.jtl">
<property name="jmeter.save.saveservice.output_format" value="csv"/>
<property name="jmeter.save.saveservice.print_field_names" value="true"/>
<property name="jmeter.save.saveservice.timestamp_format" value="ms"/>
<!--etc.-->
</jmeter>
</target>
我还建议选择 jmeter.save.saveservice.timestamp_format
属性之一(ms
或 yyyy-MM-dd HH:mm:ss
因为它可能会导致仪表板生成问题),具有不同值的重复属性名称不是一个很好的做法.
I would also recommend choosing one of jmeter.save.saveservice.timestamp_format
properties (either ms
or yyyy-MM-dd HH:mm:ss
as it might cause problems with the dashboard generation), having duplicate property names with different values is not a very good practice.
参见 五种启动方式不使用 JMeter GUI 的 JMeter 测试文章,了解有关通过 Ant 任务运行 JMeter 测试和其他启动 JMeter 测试的方法的更多信息
See Five Ways To Launch a JMeter Test without Using the JMeter GUI article for more information on running JMeter tests via Ant task and other ways of kicking off a JMeter test
这篇关于Jmeter 3.0 无法生成 ANT HTML 报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!