How to generate HTML file in Jmeter using GUI only?

I want to generate HTML output for Jmeter test using GUI steps.

jmeter -n -t sometest.jmx -l abc.csv -e -o outputhtml

I want to include the step of generating html output just like a simple Simple Data Writer

listener in the GUI.

I am using maven plugin for jmeter and I am unable to specify html output in it. If I could put this step in a test, then it could be automated easily.

+3


source to share


2 answers


Since version 2.2.0 HTML generation is built in:

Just add this to your config element :

 <generateReports>true</generateReports>

      



Here's an example pom:

 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ubikloadpack.jmeter</groupId>
<artifactId>maven-generate-reports</artifactId>
<version>1.0.0</version>
<description>Check that report generation works</description>
<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<build>
    <plugins>
        <plugin>
    <groupId>com.lazerycode.jmeter</groupId>
    <artifactId>jmeter-maven-plugin</artifactId>
    <version>2.2.0</version>
            <configuration>
                <suppressJMeterOutput>false</suppressJMeterOutput>
                <testFilesIncluded>
                    <testFilesIncluded>**/*.jmx</testFilesIncluded>
                </testFilesIncluded>
                <generateReports>true</generateReports>
            </configuration>
            <executions>
                <execution>
                    <id>configure</id>
                    <goals>
                        <goal>configure</goal>
                    </goals>
                </execution>
                <execution>
                    <id>performance test</id>
                    <goals>
                        <goal>jmeter</goal>
                    </goals>
                </execution>
                <execution>
                    <id>verify</id>
                    <goals>
                        <goal>results</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

      

+3


source


To create JMeter HTML Reporting Dashboard via Maven you need



  • override JMeter properties to create a dashboard (i.e. pass the report to format csv

    ), for example, the POM configuration would look like this:

    <jmeter.save.saveservice.output_format>csv</jmeter.save.saveservice.output_format>
    <jmeter.save.saveservice.bytes>true</jmeter.save.saveservice.bytes>
    <jmeter.save.saveservice.label>true</jmeter.save.saveservice.label>
    <jmeter.save.saveservice.latency>true</jmeter.save.saveservice.latency>
    <jmeter.save.saveservice.response_code>true</jmeter.save.saveservice.response_code>
    <jmeter.save.saveservice.response_message>true</jmeter.save.saveservice.response_message>
    <jmeter.save.saveservice.successful>true</jmeter.save.saveservice.successful>
    <jmeter.save.saveservice.thread_counts>true</jmeter.save.saveservice.thread_counts>
    <jmeter.save.saveservice.thread_name>true</jmeter.save.saveservice.thread_name>
    <jmeter.save.saveservice.time>true</jmeter.save.saveservice.time>
    
          

  • Create a dashboard at the end of your JMeter test execution via Maven Exec plugin like

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>2.2.0</version>
        <executions>
            <execution>
                <phase>verify</phase>
                <goals>
                    <goal>exec</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <executable>java</executable>
            <arguments>
                <argument>-jar</argument>
                <argument>${basedir}/target/jmeter/bin/ApacheJMeter-3.2.jar</argument>
                <argument>-g</argument>
                <argument>${basedir}/target/jmeter/results/${maven.build.timestamp}-example.jtl</argument>
                <argument>-o</argument>
                <argument>${basedir}/target/dashboard</argument>
            </arguments>
        </configuration>
    </plugin>   
    
          

0


source







All Articles