Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法使用ANT脚本生成负载测试的html报告_Ant_Jmeter_Performance Testing - Fatal编程技术网

无法使用ANT脚本生成负载测试的html报告

无法使用ANT脚本生成负载测试的html报告,ant,jmeter,performance-testing,Ant,Jmeter,Performance Testing,我已经成功地集成了ApacheAnt并对其进行了配置。我正在使用Jmeter进行负载测试 现在我正在尝试生成负载测试的HTML报告,它工作正常,直到我删除了test.jmx,并且test.HTML位于文件夹C:\apache-ant-1.9.6\bin 但由于我的测试计划名称和JTL文件名称不同,我删除了上面的test.jmx和test.html以及build.xml中指定的名称: testplan ="${testpath}/${mytestplanname}.jmx" resultlog

我已经成功地集成了ApacheAnt并对其进行了配置。我正在使用Jmeter进行负载测试

现在我正在尝试生成负载测试的HTML报告,它工作正常,直到我删除了test.jmx,并且test.HTML位于文件夹C:\apache-ant-1.9.6\bin

但由于我的测试计划名称和JTL文件名称不同,我删除了上面的test.jmx和test.html以及build.xml中指定的名称:

testplan ="${testpath}/${mytestplanname}.jmx"

 resultlog="${testpath}/${mytest}.jtl">
但现在在完成负载测试后,当我运行ant命令时,它会说:

找不到C:\apache-ant-1.9.6\bin\test.jmx

不知道为什么它仍然在查找测试文件,它应该找到我在in build.xml中指定的名称

我希望这个ant脚本生成我当前测试的HTML报告,而不是它的“test.jmx”计划

BUILD.XML如下所示:

<?xml version="1.0"?>

用于ant-jmeter.jar的样例构建文件
看见http://www.programmerplanet.org/pages/projects/jmeter-ant-task.php
要运行测试并创建输出报告,请执行以下操作:
ant-Dtest=script
要仅运行测试,请执行以下操作:
ant-Dtest=脚本运行
对现有测试输出运行报告
ant-Dtest=脚本报告
“script”参数是不带.jmx后缀的脚本名称。
其他选择:
-Dshow data=y-在故障详细信息中包含响应数据
-Dtestpath=xyz—测试文件的路径(默认user.dir)。
注意:Ant根据构建文件解释相对路径
-Djmeter.home=…-JMeter主目录的路径(默认为此生成文件的父目录)
-Dreport.title=“我的报告”-html报告的标题(默认为“负载测试结果”)
不赞成:
-Dformat=2.0-使用2.0版JTL文件,而不是2.1版
funcMode=${funcMode}
在${Report.datestamp}生成的报表
找不到所有xalan和/或serialiser JAR
XSLT格式可能无法正常工作。
检查${lib.dir}中是否有xalan和序列化程序JAR

注意:

1-我的所有测试都在路径C:\apache-jmeter-2.13\apache-jmeter-2.13\bin中


2-上面的build.xml位于路径C:\apache-jmeter-2.13\apache-jmeter-2.13\extras

您可以使用build.xml文件对.jmx文件运行apache Ant,该文件位于jmeter安装的/extras文件夹下,无需复制或删除任何内容,只需通过-D命令行参数提供位置和.jmx文件名,如:

 ant -Dtestpath=/path/to/the/folder/with/test -Dtest=testname.without.jmx.extension
假设您的JMeter脚本存在,即在
c:\tests\mytest.jmx

您需要按如下方式启动Ant:

ant -Dtestpath=c:/tests -Dtest=mytest
它将生成以下文件:

  • C:\tests\mytest.jtl
  • C:\tests\mytest.html
参考资料:


你能发布build.xml吗?@VinothS-我在运行命令时添加了build.xml
ant-Dtestpath=C:\apache-jmeter-2.13\apache-jmeter-2.13\bin-Dtest=loadtest
它以非gui模式启动负载测试,而不是以html格式生成报告。从build.xml文件:`到对现有测试输出ant-Dtest=script运行报告report`但是我的测试jmx文件在路径
C:\apache-jmeter-2.13\apache-jmeter-2.13\bin
中,那么它如何检测我是否从
C:\apache-ant-1.9.6\bin
运行它,可能
ant-Dtest=C:\apache-jmeter-2.13\apache-jmeter-2.13\bin\yourtest.jmx report
?@dmitt,是否可以使用Jmeter 3.0版本的ANT插件生成HTML报告?如果是,那么该命令是什么?很少有文章介绍如何为Maven生成报告。请让我知道你对上述问题的回答。谢谢
 ant -Dtestpath=/path/to/the/folder/with/test -Dtest=testname.without.jmx.extension
ant -Dtestpath=c:/tests -Dtest=mytest