效果:
1.把jmeter-results-detail-report_21.xsl放到jmeter的extras目录下
2.修改style的值为jmeter-results-detail-report_21.xsl
<!-- 这里用的是jmeter的extend目录里面的jmeter-results-detail-report_21.xsl报告模板 -->
<target name="report">
<tstamp> <format property="report.datestamp" pattern="yyyy/MM/dd HH:mm" /></tstamp>
<xslt
classpathref="xslt.classpath"
force="true"
in="${jmeter.result.jtlName}"
out="${jmeter.result.htmlName}"
style="${jmeter.home}/extras/jmeter-results-detail-report_21.xsl">
<param name="dateReport" expression="${report.datestamp}"/>
</xslt>
3.执行ant
C:\Users\davi\Desktop\jmeter>ant run
Buildfile: C:\Users\davi\Desktop\jmeter\build.xml
run:
test:
[jmeter] Executing test plan: C:\Users\davi\Desktop\jmeter\wl.jmx ==> C:\Users\davi\Desktop\jmeter\jtl\TestReport202005210238.jtl
[jmeter] Writing log file to: C:\apache-jmeter-3.1\bin\jmeter.log
[jmeter] Creating summariser <summary>
[jmeter] Created the tree successfully using C:\Users\davi\Desktop\jmeter\wl.jmx
[jmeter] Starting the test @ Thu May 21 14:38:20 CST 2020 (1590043100418)
[jmeter] Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
[jmeter] summary = 3 in 00:00:00 = 15.6/s Avg: 37 Min: 12 Max: 87 Err: 1 (33.33%)
[jmeter] Tidying up ... @ Thu May 21 14:38:20 CST 2020 (1590043100657)
[jmeter] ... end of run
report:
[xslt] Processing C:\Users\davi\Desktop\jmeter\jtl\TestReport202005210238.jtl to C:\Users\davi\Desktop\jmeter\html\TestReport202005210238.html
[xslt] Loading stylesheet C:\apache-jmeter-3.1\extras\jmeter-results-detail-report_21.xsl
BUILD SUCCESSFUL
Total time: 1 second
C:\Users\davi\Desktop\jmeter>
4.查看报告