ReportNG not generating index.html report inside target folder

82 views Asked by At

I had a Maven project in eclipse with Selenium & ReportNG to execute automation test suites and create Report. The report was generating in this path C:\ProjectA\promta\target\surefire-reports\index.html. Now I am trying to setup the same in my another laptop for the execution. But while executing, I am getting this error:

[TestNG] Reporter org.uncommons.reportng.HTMLReporter@6e33c391 failed
org.uncommons.reportng.ReportNGException: Failed generating HTML report.
        at org.uncommons.reportng.HTMLReporter.generateReport(HTMLReporter.java:117)
        at org.testng.TestNG.generateReports(TestNG.java:1097)
        at org.testng.TestNG.run(TestNG.java:1022)
        at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:283)
        at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
        at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:120)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
        at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
Caused by: java.io.FileNotFoundException: C:\ProjectA\promta\target\surefire-reports\html\index.html (The system cannot find the path specified)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
        at java.io.FileWriter.<init>(FileWriter.java:90)
        at org.uncommons.reportng.AbstractReporter.generateFile(AbstractReporter.java:99)
        at org.uncommons.reportng.HTMLReporter.createFrameset(HTMLReporter.java:129)
        at org.uncommons.reportng.HTMLReporter.generateReport(HTMLReporter.java:104)
        ... 9 more
[TestNG] Reporter org.uncommons.reportng.JUnitXMLReporter@3113a37 failed
org.uncommons.reportng.ReportNGException: Failed generating JUnit XML report.
        at org.uncommons.reportng.JUnitXMLReporter.generateReport(JUnitXMLReporter.java:83)
        at org.testng.TestNG.generateReports(TestNG.java:1097)
        at org.testng.TestNG.run(TestNG.java:1022)
        at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:283)
        at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
        at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:120)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
        at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
Caused by: java.io.FileNotFoundException: C:\ProjectA\promta\target\surefire-reports\xml\lbs.navsdk.test.navigation.destinationinput.TC_30726_CancelRoutePreview_results.xml (The system cannot find the path specified)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
        at java.io.FileWriter.<init>(FileWriter.java:90)
        at org.uncommons.reportng.AbstractReporter.generateFile(AbstractReporter.java:99)
        at org.uncommons.reportng.JUnitXMLReporter.generateReport(JUnitXMLReporter.java:77)

And in the path C:\ProjectA\promta\target\surefire-reports, I am getting 2 files TestSuite.txt and TEST-TestSuite.xml only and not the index.html.

I have added all required dependencies in pom.xml to create the report.I have configured the build path with reportng-1.1.2.jar and velocity-dep-1.4.jar. It can be an issue with the backend files since I have compared the automation code with the running code and everything seems fine. But I am not sure which dependent file can cause this.

This is 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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.harman.Prometeus</groupId>
    <artifactId>Prometeus_Automation</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven-compiler-plugin-version>2.3.2</maven-compiler-plugin-version>
        <maven.compliler.source>1.8</maven.compliler.source>
        <maven.compliler.source>1.8</maven.compliler.source>
            <exec.mainClass>src.test.java.lbs.navsdk.utils.ReadExcelData_CreateTestSuites</exec.mainClass>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.14.3</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
        </dependency>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>3.141.59</version>
        </dependency>

        <dependency>
            <groupId>io.appium</groupId>
            <artifactId>java-client</artifactId>
            <version>7.2.0</version>
        </dependency>

        <dependency>
            <groupId>org.uncommons</groupId>
            <artifactId>reportng</artifactId>
            <version>1.1.2</version>
            <exclusions>
                <exclusion>
                    <groupId>org.testng</groupId>
                    <artifactId>testng</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.14.0</version>
        </dependency>

        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>4.1.2</version>
        </dependency>

        <dependency>
            <groupId>ru.yandex.qatools.ashot</groupId>
            <artifactId>ashot</artifactId>
            <version>1.5.3</version>
        </dependency>

        <dependency>
            <groupId>com.codoid.products</groupId>
            <artifactId>fillo</artifactId>
            <version>1.19</version>
        </dependency>

        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <version>4.2.3</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
        </dependency>
        
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M1</version>
                <configuration>
                    <properties>
                        <property>
                            <name>usedefaultlisteners</name>
                            <value>false</value>
                        </property>
                        <property>
                            <name>listener</name>
                            <value>org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter</value>
                        </property>

                    </properties>   

                    <suiteXmlFiles>
                        <suiteXmlFile>AutomationSuite.xml</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.16</version>
                <configuration>
                    <outputDirectory>target</outputDirectory>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>2.1</version>
                <configuration>
                    <outputDirectory>target</outputDirectory>
                </configuration>
            </plugin>

        </plugins>

        <defaultGoal>test</defaultGoal>
    </build>

</project>
0

There are 0 answers