If you press jmeter default settings, the resulting report is as follows:
As can be seen, the result information is relatively simple, for the success of the case, can also be used. But for a failed case, there is only one row of assert error messages. (Too little information, difficult to find the reason for failure)
Optimize the approximate process:
1. Download style file: jmeter.results.shanhe.me.xsl
2. Put the downloaded files in the JMeter Extras directory.
3, modify the Jmeter.properties file as follows, I have changed to true here, so that after executing the script will save these results into the. jtl file:
Jmeter.save.saveservice.data_type=truejmeter.save.saveservice.label=truejmeter.save.saveservice.response_code= true# Response_data isn't currently supported for CSV outputjmeter.save.saveservice.response_data=true# save ResponseData for failed samplesjmeter.save.saveservice.response_data.on_error= Falsejmeter.save.saveservice.response_message=truejmeter.save.saveservice.successful= Truejmeter.save.saveservice.thread_name=truejmeter.save.saveservice.time= truejmeter.save.saveservice.subresults=truejmeter.save.saveservice.assertions= Truejmeter.save.saveservice.latency=truejmeter.save.saveservice.connect_time= truejmeter.save.saveservice.samplerdata=truejmeter.save.saveservice.responseheaders= truejmeter.save.saveservice.requestheaders=truejmeter.save.saveservice.encoding= Falsejmeter.save.saveservice.bytes=truejmeter.save.saveservice.url=truejmeter.save.saveservice.filename= truejmeter.save.saveservice.hostname=truejmeter.save.saveservice.thread_counts= Truejmeter.save.saveservice.sample_count=tRuejmeter.save.saveservice.idle_time=true
4. After the modified full Build.xml file, the value of the following style is modified to the newly downloaded XSL file name:
<?xml version= "1.0" encoding= "UTF-8"? ><project name= "Ant-jmeter-test" default= "Run" basedir= "." > <!--need to change to their local Jmeter directory--<property name= "Jmeter.home" value= "/users/tools/jmeter"/> <PR Operty name= "Report.title" value= "interface Test"/> <!--jmeter Generate JTL Format Results report path--<property name= "JMETER.RESULT.J Tl.dir "value="/users/desktop/jmx/report "/> <!--jmeter Generate HTML formatted Results report path--<property name=" Jmeter.resul T.html.dir "value="/users/desktop/jmx/report "/> <!--generated report prefixes--<property name=" ReportName "value=" T Estreport "/> <property name=" jmeter.result.jtlName "value=" ${jmeter.result.jtl.dir}/${reportname}.jtl "/> <property name= "Jmeter.result.htmlName" value= "${jmeter.result.html.dir}/${reportname}.html"/> <target Name= "Run" > <antcall target= "Test"/> <antcall target= "Report"/> </target> & Lt;target name= "Test" > <taskdef namE= "JMeter" classname= "Org.programmerplanet.ant.taskdefs.jmeter.JMeterTask"/> <jmeter jmeterhome= "${jmeter.h ome} "resultlog=" ${jmeter.result.jtlname} "> <!--declares the script to run" *.jmx "means all JMeter scripts that contain this directory--<t Estplans dir= "/users/desktop/jmx" 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 property=" Report.d Atestamp "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-shanhe-me.xsl "> <param name=" datereport "expression=" ${report.datestamp} "/> </xslt> <!--Because when the report is generated, the associated pictures are not copied to the target directory, so you need to manually copy--<copy todir= "${jmeter.re Sult.html.dir} "> <fileset dir=" ${jmeter.home}/extras "> <include name=" collapse.png " /> <include name= "expand.png"/> </fileset> </copy> </TARGET&G T;</project>
5, execute the script, generate reports as follows, obviously feel the content of the display more than the previous report, positioning problems are more convenient and intuitive:
"JMeter" test report optimization