Linked Questions

Popular Questions

JMeter HTML Dashboard report not displaying in Jenkins

Asked by At

I'm unable to view the Jmeter Dashboard report in Jenkins, however the jenkins job creates a index.html report but it's empty

jenkins

it works fine locally and index.html is generated with all the required values.

local

What am i missing over here?

here's my pom.xml

    <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.performance.dataengg</groupId>
  <artifactId>DataEngg</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>

  <name>DataEngg</name>
  <url>http://maven.apache.org</url>

  <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <profiles>
        <profile>
            <id>Windows</id>
            <activation>
                <os>
                    <family>Windows</family>
                </os>
            </activation>
            <properties>
                <script.extension>.bat</script.extension>
            </properties>
        </profile>
        <profile>
            <id>unix</id>
            <activation>
                <os>
                    <family>unix</family>
                </os>
            </activation>
            <properties>
                <script.extension>.sh</script.extension>
            </properties>
        </profile>
    </profiles>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${basedir}/htmlReport/Reporting_framework/</directory>
                            <includes>
                                <include>AggregateReport.csv</include>
                                <include>Report.html</include>
                                <include>ReportOutput.zip</include>
                            </includes>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>

            <plugin>
                <groupId>com.lazerycode.jmeter</groupId>
                <artifactId>jmeter-maven-plugin</artifactId>
                <version>2.7.0</version>
                <configuration>
                    <propertiesUser>
                        <threads>${threads}</threads>
                        <rampUp>${rampUp}</rampUp>
                        <baseURL>${baseURL}</baseURL>
                        <Pconstantthroughputtimer>${constantThroughputTimer}</Pconstantthroughputtimer>
                        <Resultsdirectory>${basedir}/target/jmeter/results/*.jtl</Resultsdirectory>
                        <loopCountDuration>${loopCountDuration}</loopCountDuration>

                    </propertiesUser>
                </configuration>
                <executions>
                    <!-- Run JMeter tests -->
                     <execution>
                        <id>jmeter-tests</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jmeter</goal>
                        </goals>
                    </execution>
                    <!-- Fail build on errors in test -->
                </executions>
            </plugin>

             <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>pre-site</phase>
                        <configuration>
                            <tasks>
                                <delete dir="${basedir}/target/jmeter/results/dashboard" />
                                <mkdir dir="${basedir}/target/jmeter/results/dashboard" />
                                <copy file="${basedir}/src/test/resources/reportgenerator.properties"
                                         tofile="${basedir}/target/jmeter/bin/reportgenerator.properties" />
                                <copy todir="${basedir}/target/jmeter/bin/report-template">
                                    <fileset dir="${basedir}/src/test/resources/report-template" />
                                </copy>
                                <java jar="${basedir}/target/jmeter/bin/ApacheJMeter-4.0.jar" fork="true">
                                    <arg value="-l" />
                                    <arg value="${basedir}/target/jmeter/results/*.jtl" />
                                    <arg value="-g" />
                                    <arg value="${basedir}/target/jmeter/results/*.jtl" />
                                    <arg value="-o" />
                                    <arg value="${basedir}/target/jmeter/results/dashboard/" />
                                </java>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

Can it be some jenkins configuration that's going wrong?

Related Questions