性能测试持续集成(Jenkins+Ant+Jmeter) 打印 E-mail
作者:WhoisTester   
2016-03-10 23:10
一、环境准备:
1、JDK:http://www.oracle.com/technetwork/java/javase/downloads/index.html
2、Jmeter:http://jmeter.apache.org/download_jmeter.cgi
3、Ant:http://ant.apache.org/bindownload.cgi
4、tomcat:http://tomcat.apache.org/
5、Jenkins:http://jenkins-ci.org/
二、Jemter脚本准备:
1、脚本内容:访问baidu首页
2、脚本路径:
D:\apache-jmeter-2.13\demo
三、通过ant的 build.xml执行性能脚本(以jmx结尾)生成测试报告
1、首先将 jmeter的extras目录中ant-jmeter-1.1.1.jar包拷贝至ant安装目录下的lib目录中;
其次修改Jmeter的bin目录下jmeter.properties文件的配置:jmeter.save.saveservice.output_format=xml
2、编写build.xml
Sample build file for use with ant-jmeter.jar
See http://www.programmerplanet.org/pages/projects/jmeter-ant-task.php
To run a test and create the output report:
ant -Dtest=script
To run a test only:
ant -Dtest=script run
To run report on existing test output
ant -Dtest=script report
The "script" parameter is the name of the script without the .jmx suffix.
Additional options:
-Dshow-data=y - include response data in Failure Details
-Dtestpath=xyz - path to test file(s) (default user.dir).
N.B. Ant interprets relative paths against the build file
-Djmeter.home=.. - path to JMeter home directory (defaults to parent of this build file)
-Dreport.title="My Report" - title for html report (default is 'Load Test Results')
Deprecated:
-Dformat=2.0 - use version 2.0 JTL files rather than 2.1
classpathref="/jmeter.classpath"
classname="org.programmerplanet.ant.taskdefs.jmeter.JMeterTask"/>
funcMode = ${funcMode}
classpathref="/xslt.classpath"
force="true"
in="${jmeter.result.jtlName}"
out="${jmeter.result.htmlName}"
style="${jmeter.home}/extras/jmeter-results-detail-report_21.xsl">
Cannot find all xalan and/or serialiser jars
The XSLT formatting may not work correctly.
Check you have xalan and serializer jars in ${lib.dir}

 

发表评论


安全码
刷新