TestNG Report is not displaying more than 21 tests

231 Views Asked by At

I have a maven project that is running testNG tests via a Testng xml. The XML has the following listeners

<listener class-name="org.uncommons.reportng.HTMLReporter" /> 
<listener class-name="org.uncommons.reportng.JUnitXMLReporter" />

I have 24 tests in the xml with all of them running packages e.g

<test name="First Test"
    preserve-order="true">
    <packages>
        <package
            name="testProject.first.*" />
    </packages>
</test>

For some reason all 24 tests run but in the testng report I only ever see 21 tests. The 21 tests that show are not always consistent so that rules out the possibillity of a problem with the setup of some tests. I am wondering if there is possibly a max number of tests that run and if I need to combine tests? or is there a maximum number of tests parameter somewhere that can be set?

The following is my maven-surefire-plugin setup

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12</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>
                        <systemPropertyVariables>
                            <environment>${env.browser}</environment>
                        </systemPropertyVariables>
                        <systemPropertyVariables>
                            <environment>${env.environment}</environment>
                        </systemPropertyVariables>
                        <systemPropertyVariables>
                            <environment>${env.testlinkRelease}</environment>
                        </systemPropertyVariables>
                    </properties>
                    <suiteXmlFiles>
                        <suiteXmlFile>src/testCleanup/${cleanup.suite}</suiteXmlFile>
                        <suiteXmlFile>src/limelightTests/${test.suite}</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
            </plugin>

Thanks for any help.

1

There are 1 best solutions below

0
Ray On

I found the issue. I had a screenshot listener that was running after @AfterMethod had run. @AfterMethod quit the driver so the screenshot listener ended up throwing an error which was not caught and caused the test to be left out of the report.