• 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地址后就可以了

  • 相关阅读:
    Spring注解驱动开发3:自动装配
    Spring注解驱动开发2:生命周期和属性赋值
    Spring注解驱动开发1:组件注册
    Java线程及其实现方式
    Winform 可取消的单选按钮(RadioButton)
    autoit脚本-从基本的函数用法开始
    python进阶(一)
    dict字典的一些优势和劣势
    读《流畅的python》第一天
    智能化脚本autoit v3的简单了解
  • 原文地址:https://www.cnblogs.com/520502-thy/p/9467179.html
Copyright © 2020-2023  润新知