简体   繁体   中英

how to configure maven to generate more detail Jmeter results similar to the view Results Tree in Jmeter GUI?

I'm trying to integrate Jmeter tests with maven and running from bamboo. I see the Test result as passed( see my output from bamboo or same result even if I run locally)but it doesn't provide me more details like my request , reply xml similar to what I see when I run the scripts from Jmeter GUI under View Results Tree. I even tried with the analysis plugin but still didn't see what I expected. Is there a way in maven(like any plugin) that generates detail report similar to what we see in the View Results Tree? Any help would be really appreciated.

[info] Completed Test: Demo Test.jmx
16-Sep-2015 13:49:32    [INFO]  
16-Sep-2015 13:49:32    [INFO] Test Results:
16-Sep-2015 13:49:32    [INFO]  
16-Sep-2015 13:49:32    [INFO] Tests Run: 1, Failures: 0

Here is my POM:

<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>jmeter-demo</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>jmeter-demo</name>
<url>http://maven.apache.org</url>

<build>
    <plugins>
        <plugin>
            <groupId>com.lazerycode.jmeter</groupId>
            <artifactId>jmeter-maven-plugin</artifactId>
            <version>1.9.1</version>
            <executions>
                <execution>
                    <id>jmeter-tests</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>jmeter</goal>
                    </goals>
                </execution>
            </executions>
            </plugin>

            <plugin>
          <groupId>com.lazerycode.jmeter</groupId>
          <artifactId>jmeter-analysis-Maven-plugin</artifactId>
          <executions>
            <execution>
              <phase>verify</phase>
              <goals>
                <goal>analyze</goal>
              </goals>
              <configuration>
                <source>${project.build.directory}/**/*.jtl</source>
                <targetDirectory>${project.build.directory}/testresults/</targetDirectory>
              </configuration>
            </execution>
           </executions>
        </plugin>

    </plugins>
</build>

Thanks in advance

You need to perform some additional configuration to store request and response data. Modify your <execution> section as follows:

<execution>
    <id>jmeter-tests</id>
    <phase>verify</phase>
    <goals>
        <goal>jmeter</goal>
    </goals>
    <configuration>
        <propertiesJMeter>
            <jmeter.save.saveservice.response_data>true</jmeter.save.saveservice.response_data>
            <jmeter.save.saveservice.samplerData>true</jmeter.save.saveservice.samplerData>
            <jmeter.save.saveservice.requestHeaders>true</jmeter.save.saveservice.requestHeaders>
            <jmeter.save.saveservice.url>true</jmeter.save.saveservice.url>
            <jmeter.save.saveservice.responseHeaders>true</jmeter.save.saveservice.responseHeaders>
        </propertiesJMeter>
    </configuration>
</execution>

and you'll get result file suitable for analysis with the View Results Tree listener.

References:

Be aware that storing any extra information increases Disk IO on JMeter side and in case of large responses or large number of threads or both can ruin your test so use these settings carefully and revert them to defaults once you're happy with your script for the actual load test.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM