"JMeter" test report optimization

Source: Internet
Author: User
Tags xsl xsl file xslt

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"/> &LT;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> &LT;/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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.