0

I am using Jmeter with Maven plugin and generating html report for the same after execution, have addded .jmx files in src/test/jmeter folder and kept csv in different one for reading params.

This is how my pom.xml looks like for build.

<build>
    <plugins>
        <plugin>
            <groupId>com.lazerycode.jmeter</groupId>
            <artifactId>jmeter-maven-plugin</artifactId>
            <version>3.4.0</version>
            <executions>
                <!-- Generate JMeter configuration -->
                <execution>
                    <id>configuration</id>
                    <goals>
                        <goal>configure</goal>
                    </goals>
                </execution>
                <!-- Run JMeter tests -->
                <execution>
                    <id>jmeter-tests</id>
                    <goals>
                        <goal>jmeter</goal>
                    </goals>
                </execution>
                <!-- Fail build on errors in test -->
                <execution>
                    <id>jmeter-check-results</id>
                    <goals>
                        <goal>results</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <propertiesUser>
                    <csvPath>${basedir}/src/test/resources/testData.csv</csvPath>
                </propertiesUser>
                <generateReports>true</generateReports>
            </configuration>
        </plugin>
    </plugins>
</build>

I am getting result.csv properly but html report is showing data from some random execution which was 1st time for the day.

Please let me know if I am missing something here.

Thanks in advance!!!

QA-Palash
  • 197
  • 2
  • 12

1 Answers1

0
  1. By default the report is being generated under target/jmeter/reports/your_test_name/ folder

  2. If the "old" report exists - you will get the following error message:

    An error occurred: Cannot write to 'target/jmeter/reports/your_test_name' as folder is not empty
    

So double check the path you're opening in the browser and just in case make sure to call clean task, i.e. instead of :

maven verify

call

maven clean verify

You can also always generate the HTML dashboard from the .csv results file as:

jmeter -g /path/to/CSV/file -o /path/to/dashboard/folder

and last but not the least, have you tried to refresh the dashboard page in the browser?

More information: How to Use the JMeter Maven Plugin

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • seems like some issue with eclipse only, if I access "index.html" file from System Explorer it's showing the proper one. But in Eclipse project explorer it's showing cached ones. Have closed and reopened Eclipse and working fine now. – QA-Palash Aug 05 '21 at 12:46