问题描述
我试图用ant运行Jmeter(因为我想显示所有步骤的测试结果).问题是,在设法运行命令后,Jtl文件为空,我试图运行基本的test.jmx默认测试.我运行命令ant -Detest = Test run构建成功,但jtl结果为空.此外,它在一秒钟后完成,而如果我通过UI模式运行,则需要花费更多时间.
I am trying to run Jmeter with ant, (since I want to display the results of test, with all the steps).The issue is that after I managed to run the command the Jtl file is empty, I am trying to run the basic test.jmx default test.I run the command ant -Detest=Test runthe build is successful but the jtl results are empty. moreover it is finished after one second, while if I run via UI mode it should take more time.
有人可以建议如何在Jmeter中使用ant,或者如何获得完整的报告,例如在html中的csv中?
Can someone please advise how to use ant with Jmeter, or how to get fully reports like in csv in html out put?
[] [生成结果]
[][build results]
[] [来自ant \ bin位置的build.xml]
[][build.xml from ant\bin location]
[] [test.jtl结果文件的位置]
[][location of test.jtl results file]
[] [结果为空]
[][results are empty]
推荐答案
您的JMeter测试本身很可能有问题,即
Most probably something is wrong with your JMeter test itself, i.e.
- JMeter failed to start (installation or configuration issues)
- it has 0 threads in Thread Group
- there is an If Controller condition which prevent test execution
- the test relies on a JMeter Plugin which is not installed
- etc.
因此,我建议修改您的 build.xml 文件,并通过在<jmeter>
部分添加以下行来启用写入JMeter日志文件:jmeterlogfile="${testpath}/jmeter-ant.log >
So I would recommend amending your build.xml file and enable writing JMeter log file by adding the next line to <jmeter>
section: jmeterlogfile="${testpath}/jmeter-ant.log >
所以看起来像
<jmeter
jmeterhome="${jmeter.home}"
testplan ="${testpath}/${test}.jmx"
resultlog="${testpath}/${test}.jtl"
jmeterlogfile="${testpath}/jmeter-ant.log>
再次运行测试时,您应该在.jmx文件所在的文件夹中看到jmeter-ant.log
文件.
When you run your test one more time you should see jmeter-ant.log
file in the folder where your .jmx file lives.
更多信息: JMeter Ant Task
这篇关于使用ant运行Jmeter时Jtl文件为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!