Convert JTL reports to HTML reports using Xsltproc

Source: Internet
Author: User
Tags xsl

It is not possible to generate HTML reports directly after the JMeter test, but instead to JTL reports. Here we can use Xsltproc to solve.

Xsltproc is a fast XSLT engine written by Danielveillard for the C language,
It can convert XML to a file of the appropriate format through an XSL cascading style sheet.
For example: Html,xhtml,pdf ...

XSL refers to the extended style sheet language (extensible Stylesheet Language),
converting XML to HTML is a style sheet written in xls,
So if you want to extend this report, first be familiar with XLS,
To change and extend the style sheet.
You can learn this language here in http://www.w3school.com.cn/xsl/index.asp.

Idea+jmeter Test Environment Construction

    1. Modifying the Jmeter.properties configuration file
      Jmeter.save.saveservice.output_format=xml

    2. Download the Xsltproc file and unzip it and add the executable path to the environment variable.
      Download path: Link: https:pan.baidu.com/s/1qzpolwo Password: ky88

      refer to this article: http:www.crifan.com/files/doc/docbook/docbook_dev_note/release/webhelp/download_xsltproc_win.html

    3. To copy a report template file
      The JMeter installation directory \extras under Jmeter-results-detail-report_21.xsl and
      Copy the jmeter-results-report_21.xsl template file to
      Src\test\resources folder, under the JMeter folder, place the. jmx file,
      If the report cannot be expanded, copy collapse.png and expand.png to the resources folder

    4. Modify the Pom file
      <plugin>  <groupId>com.lazerycode.jmeter</groupId>  <artifactId> jmeter-maven-plugin</artifactid>  <version>2.1.0</version>   <ignoreresultfailures >true</ignoreResultFailures>   <testResultsTimestamp>false</ testresultstimestamp>   <testFilesIncluded>     <jmetertestfile>testdemo.jmx</ jmetertestfile>   </testFilesIncluded>  <executions>     <execution>         <id >jmeter-tests</id>         <phase>verify</phase>         <goals>         <goal>jmeter </goal>         </goals>      </execution>   </executions></plugin>
    5. Execute verify, and then enter the following code in the command line to output the HTML report
      Xsltproc-o target/jmeter/results/testdemo.html src/test/resources/jmeter-results-detail-report_21.xsl target/ Jmeter/results/testdemo.jtl
    6. View Reports

Next is to integrate with Jenkins, do continuous integration testing, will be in the next article detailed introduction, please look forward to!

Convert JTL reports to HTML reports using Xsltproc

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.