ant+jenkins+jmeter接口自动化
Posted 520502-thy
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ant+jenkins+jmeter接口自动化相关的知识,希望对你有一定的参考价值。
1.网址:https://www.cnblogs.com/ceshisanren/p/5639886.html
2.bulid.xml文件
<?xml version="1.0" encoding="UTF-8"?>
-<project basedir="." default="run" name="ant-jmeter-test">
-<tstamp>
<format pattern="yyyyMMddhhmm" property="time"/>
</tstamp>
<property name="jmeter.home" value="D: oolsapache-jmeter-3.1"/>
<property name="jmeter.result.jtl.dir" value="D: oolsapache-jmeter-3.1in est eportjtl"/>
<property name="jmeter.result.html.dir" value="D: oolsapache-jmeter-3.1in est eporthtml"/>
<property name="ReportName" value="TestReport"/>
<property name="jmeter.result.jtlName" value="${jmeter.result.jtl.dir}/${ReportName}${time}.jtl"/>
<property name="jmeter.result.htmlName" value="${jmeter.result.html.dir}/${ReportName}${time}.html"/>
-<target name="run">
<antcall target="test"/>
<antcall target="report"/>
</target>
-<target name="test">
<taskdef name="jmeter" classname="org.programmerplanet.ant.taskdefs.jmeter.JMeterTask"/>
-<jmeter resultlog="${jmeter.result.jtlName}" jmeterhome="${jmeter.home}">
<testplans dir="D: oolsapache-jmeter-3.1in est" includes="*.jmx"/>
<property name="jmeter.save.saveservice.output_format" value="xml"/>
</jmeter>
</target>
-<path id="xslt.classpath">
<fileset dir="${jmeter.home}/lib" includes="xalan*.jar"/>
<fileset dir="${jmeter.home}/lib" includes="serializer*.jar"/>
</path>
-<target name="report">
-<tstamp>
<format pattern="yyyy/MM/dd HH:mm" property="report.datestamp"/>
</tstamp>
<xslt style="${jmeter.home}/extras/jmeter-results-detail-report_21.xsl" out="${jemter.result.htmlName}" in="${jmeter.result.jtlName}" force="true" classpathref="xslt.classpath"/>
-<copy todir="${jmeter.result.html.dir}">
-<fileset dir="${jmeter.home}/extras">
<include name="collapse.png"/>
<include name="expand.png"/>
</fileset>
</copy>
</target>
</project>
3注意:
a:build.xml文件地址存在问题时一直走不通,最后放在jemter文件的D: oolsapache-jmeter-3.1in estsmokeTest地址后就可以了
以上是关于ant+jenkins+jmeter接口自动化的主要内容,如果未能解决你的问题,请参考以下文章
JMeter接口测试系列:Jmeter+jenkins+ant 的自动化构建
Jenkins+Ant+Jmeter接口自动化测试(持续构建)