使用ant运行Jmeter时Jtl文件为空 [英] Jtl file is empty when running Jmeter using ant

查看:695
本文介绍了使用ant运行Jmeter时Jtl文件为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用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 run the 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无法启动(安装或配置问题)
  • 它在线程组
  • 中有0个线程
  • 有一个如果是控制器导致无法执行测试的条件
  • 该测试依赖于尚未安装的JMeter插件
  • 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文件为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆