• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

关于Ant+JMeter进行Web应用的稳定性测试

发布: 2008-1-31 12:45 | 作者: 网络转载 | 来源: 网络转载 | 查看: 118次 | 进入软件测试论坛讨论

领测软件测试网


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/

22/2<12

关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网