<?xml version="1.0" encoding="utf-8"?> <project name="pc" default="all" basedir="D:\jmeter-5.4"> <tstamp> <format property="time" pattern="yyyyMMddhhmm" /> </tstamp> <!-- Need to change to your own local Jmeter directory - > <property name="jmeter.home" value="D:\jmeter-5.4" /> <! -- path to jmeter to generate result reports in jtl format -- > <property name="jmeter.result.jtl.dir" value="D:\jmeter-5.4\test\resultlog\jtl" /> <! -- Path to the html formatted result report generated by jmeter -- > <property name="jmeter.result.html.dir" value="D:\jmeter-5.4\test\resultlog\html" /> <! -- the prefix of the generated report--> <property name="ReportName" value="TestReport" /> <property name="jmeter.result.htmlName" value="${jmeter.result.html.dir}/${ReportName}${time}.html" /> <property name="jmeter.result.jtlName" value="${jmeter.result.jtl.dir}/${test}${time}.jtl" /> <!-- E-mail address for receiving test reports --> <property name="mail_from" value="[email protected]" /> <property name="mail_to" value="[email protected]" /> <!-- Computer Address --> <!-- <property name="ComputerName" value="jkqsh-l0285" />--> <target name="all"> <antcall target="test" /> <antcall target="report" /> <antcall target="sendmail" /> </target> <target name="test"> <taskdef name="jmeter" classname="org.programmerplanet.ant.taskdefs.jmeter.JMeterTask" /> <jmeter jmeterhome="${jmeter.home}" resultlog="${jmeter.result.jtlName}"> <!-- Declare the scripts to be run." *.jmx" means all jmeter scripts in this directory --> <testplans dir="D:\jmeter-5.4\test\script" /> </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"> <xslt classpathref="xslt.classpath" force="true" in="${jmeter.result.jtlName}" out="${jmeter.result.htmlName}" style="${jmeter.home}/extras/jmeter.results.shanhe.me.xsl"> <param name="dateReport" expression="${time}"/> </xslt> <!-- Because the above report generation will not copy the related images to the target directory, so you need to copy them manually --> <copy todir="${jmeter.result.html.dir}"> <fileset dir="${jmeter.home}/extras"> <include name="collapse.png" /> <include name="expand.png" /> </fileset> </copy> </target> <!-- send files --> <target name="sendmail" > <mail mailhost="smtp.163.com" mailport="994" ssl="true" user="${mail_from}" password="xxx" subject="Interface Test Report" from="${mail_from}" > <to address="${mail_to}"/> <message>For a detailed report, please see the attachment</message> <attachments> <fileset dir="${jmeter.result.html.dir}"> <include name="${ReportName}${time}.html"/> </fileset> </attachments> </mail> </target> </project>
Solution:
Call 163 mailbox server to send mail. We need to start POP3/SMTP service. At this time, 163 mail will let us set the client authorization code. This authorization code can successfully send mail by replacing passwd
in the code part above
Similar Posts:
- jmeter-Unable to access jarfile ApacheJMeter.jar
- Solution to the problem of not able to find Java executable or version in JMeter installation
- [Solved] JMeter startup error: integer expression expected
- Error in JMeter import JMX file cannotresolveclassexception: kg.apc.jmeter.perfmon.perfmoncollector solution
- [Solved] Jmeter Error: Not able to find Java executable or version. Please check your Java installation.
- [Solved] Error: target controller is configured to “use recording Controller” but no such controller exists,ensure you add a Recording Controller as child of Thread Group node to start recording correctly
- How to Solve JMeter beanshellsampler error
- Solution of JMeter pressure test “Java. Net. Socketexception: socket closed”
- Solution of JMeter pressure test “Java.Net.Socketexception: socket closed”
- javax.imageio.IIOException: Can’t read input file! 23436;”209151;