D:\ProgramFiles\jakarta-jmeter-2.1.1\mytest\web3>ant
Buildfile: build.xml
test:
[jmeter] Executing test plan: D:\ProgramFiles\jakarta-jmeter-2.1.1\mytest\web
3\web1.jmx
[jmeter] Created the tree successfully
[jmeter] Starting the test
[jmeter] Tidying up ...
[jmeter] ... end of run
[echo] jmeter web1.jmx finished
interval:
[echo] sleep 5 seconds
[echo] continue
test2:
[jmeter] Executing test plan: D:\ProgramFiles\jakarta-jmeter-2.1.1\mytest\web
3\web1.jmx
[jmeter] Created the tree successfully
[jmeter] Starting the test
[jmeter] Tidying up ...
[jmeter] ... end of run
[echo] jmeter web1.jmx finished
interval:
[echo] sleep 5 seconds
[echo] continue
test:
[jmeter] Executing test plan: D:\ProgramFiles\jakarta-jmeter-2.1.1\mytest\web
3\web1.jmx
[jmeter] Created the tree successfully
[jmeter] Starting the test
[jmeter] Tidying up ...
[jmeter] ... end of run
[echo] jmeter web1.jmx finished
interval:
[echo] sleep 5 seconds
[echo] continue
test2:
[jmeter] Executing test plan: D:\ProgramFiles\jakarta-jmeter-2.1.1\mytest\web
3\web1.jmx
[jmeter] Created the tree successfully
[jmeter] Starting the test
[jmeter] Tidying up ...
[jmeter] ... end of run
[echo] jmeter web1.jmx finished
interval:
[echo] sleep 5 seconds
[echo] continue
test:
[jmeter] Executing test plan: D:\ProgramFiles\jakarta-jmeter-2.1.1\mytest\web
3\web1.jmx
[jmeter] Created the tree successfully
[jmeter] Starting the test
[jmeter] Tidying up ...
[jmeter] ... end of run
[echo] jmeter web1.jmx finished
interval:
[echo] sleep 5 seconds
[echo] continue
test2:
[jmeter] Executing test plan: D:\ProgramFiles\jakarta-jmeter-2.1.1\mytest\web
3\web1.jmx
[jmeter] Created the tree successfully
[jmeter] Starting the test
[jmeter] Tidying up ...
[jmeter] ... end of run
[echo] jmeter web1.jmx finished
interval:
[echo] sleep 5 seconds
[echo] continue
test:
[jmeter] Executing test plan: D:\ProgramFiles\jakarta-jmeter-2.1.1\mytest\web
3\web1.jmx
[jmeter] Created the tree successfully
[jmeter] Starting the test
[jmeter] Tidying up ...
[jmeter] ... end of run
[echo] jmeter web1.jmx finished
interval:
[echo] sleep 5 seconds
[echo] continue
test2:
[jmeter] Executing test plan: D:\ProgramFiles\jakarta-jmeter-2.1.1\mytest\web
3\web1.jmx
[jmeter] Created the tree successfully
[jmeter] Starting the test
[jmeter] Tidying up ...
[jmeter] ... end of run
[echo] jmeter web1.jmx finished
interval:
[echo] sleep 5 seconds
[echo] continue
test:
[jmeter] Executing test plan: D:\ProgramFiles\jakarta-jmeter-2.1.1\mytest\web
3\web1.jmx
[jmeter] Created the tree successfully
[jmeter] Starting the test
[jmeter] Tidying up ...
[jmeter] ... end of run
[echo] jmeter web1.jmx finished
interval:
[echo] sleep 5 seconds
[echo] continue
test2:
[jmeter] Executing test plan: D:\ProgramFiles\jakarta-jmeter-2.1.1\mytest\web
3\web1.jmx
[jmeter] Created the tree successfully
[jmeter] Starting the test
[jmeter] Tidying up ...
[jmeter] ... end of run
[echo] jmeter web1.jmx finished
interval:
[echo] sleep 5 seconds
[echo] continue
test:
[jmeter] Executing test plan: D:\ProgramFiles\jakarta-jmeter-2.1.1\mytest\web
3\web1.jmx
[jmeter] Created the tree successfully
[jmeter] Starting the test
[jmeter] Tidying up ...
[jmeter] ... end of run
[echo] jmeter web1.jmx finished
interval:
[echo] sleep 5 seconds
终止批处理操作吗(Y/N)? y
D:\ProgramFiles\jakarta-jmeter-2.1.1\mytest\web3>
e,综合,可以使用此方法来达要求。当你想停止测试时,则手动停止即可。查看上面的这个build
< !-- Simple Ant Jmeter test-->
< project name="antjmeter" default="run" basedir=".">
< property name="out" value="."/>
< target name="test">
< taskdef
name="jmeter"
classname="org.programmerpl.net.ant.taskdefs.jmeter.JMeterTask"/>
< jmeter
jmeterhome="D:\ProgramFiles\jakarta-jmeter-2.1.1"
testplan="${basedir}/web1.jmx"
resultlog="${out}/web1.jtl">
< jvmarg value="-Dgroup1.threads=10"/>
< /jmeter>
< echo message="jmeter web1.jmx finished"/>
< antcall target="interval"/>
< antcall target="test2"/>
< !--ant antfile="build.xml"/-->
< /target>
< !--for execute target test many times,copy the target test
to target test2-->
< target name="test2">
< taskdef
name="jmeter"
classname="org.programmerplanet.ant.taskdefs.jmeter.JMeterTask"/>
< jmeter
jmeterhome="D:\ProgramFiles\jakarta-jmeter-2.1.1"
testplan="${basedir}/web1.jmx"
resultlog="${out}/web1.jtl">
< jvmarg value="-Dgroup1.threads=10"/>
< /jmeter>
< echo message="jmeter web1.jmx finished"/>
< antcall target="interval"/>
< antcall target="test"/>
< !--ant antfile="build.xml"/-->
< /target>
< target name="interval">
< echo message="sleep 5 seconds"/>
< sleep seconds="5"/>
< echo message="continue"/>
< /target>
< target name="tfile">
< xslt
in="${basedir}/web1.jtl"
out="${basedir}/web1.html"
style="${basedir}/jmeter-results-detail-report.xsl"/>
< /target>
< target name="run" depends="test"/>
< /project>
文章来源于领测软件测试网 https://www.ltesting.net/