ReportNG does not create a report

736 views
Skip to first unread message

sabf

unread,
Jul 28, 2011, 3:28:19 AM7/28/11
to testng...@googlegroups.com
Hello,

i try to use ReportNG (http://reportng.uncommons.org/).
I configure it, but only the standart TestNG Reports are created.
Here is my pom.xml, I hope anybody can help me.

Thanks.

<?xml version="1.0" encoding="UTF-8"?>
<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>de.edict.edict-testutils.selenium-tests</groupId>
    <artifactId>portalseleniumtwo</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>${project.artifactId}</name>

    <parent>
        <groupId>xxxxx</groupId>
        <artifactId>xxxx</artifactId>
        <version>2.9</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>5.14</version>
          <!--  <classifier>jdk15</classifier> -->
        </dependency>
        <dependency>
            <groupId>org.uncommons</groupId>
            <artifactId>reportng</artifactId>
            <version>1.1.2</version>
            <!--<scope>test</scope> -->
            <exclusions>
                <exclusion>
                    <groupId>org.testng</groupId>
                    <artifactId>testng</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
    <properties>
        <webSite>https://tstweb08c.xxxxx.com</webSite>
        <seleniumHost>tstcli05c:5554</seleniumHost>
        <suiteXmlFile>testng-smoketests.xml</suiteXmlFile>
       <!-- <testName>Portal SmokeTest Firefox 3.6.15 on Windows 7 tstcli05c</testName> -->
    </properties>
    <profiles>
        <profile>
            <id>smoketest</id>
            <activation>
                <property>
                    <name>do</name>
                    <value>smoketest</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <!--Run Testng from Surefire to add results to site docu -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.9</version>
                       <!-- <artifactId>maven-surefire-plugin</artifactId> -->
                        <configuration>
                            <systemPropertyVariables>
                                <org.uncommons.reportng.escape-output>false</org.uncommons.reportng.escape-output>   
                            </systemPropertyVariables>
                            <systemProperties>
                                <property>
                                    <name>usedefaultlisteners</name>
                                    <value>false</value>
                                </property>
                                <property>
                                    <name>listener</name>
                                    <value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter</value>
                                </property>
                                <workingDirectory>target/surefire-reports/</workingDirectory>
                                <property>
                                    <name>browser</name>
                                    <value>${browser}</value>
                                </property>
                                <property>
                                    <name>webSite</name>
                                    <value>${webSite}</value>
                                </property>
                                <property>
                                    <name>seleniumHost</name>
                                    <value>${seleniumHost}</value>
                                </property>
                                <property>
                                    <name>seleniumPort</name>
                                    <value>${seleniumPort}</value>
                                </property>
                            </systemProperties>
                            <suiteXmlFiles>
                                <suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
                            </suiteXmlFiles>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

Tomek Kaczanowski

unread,
Jul 28, 2011, 3:56:00 AM7/28/11
to testng...@googlegroups.com
not sure about it, but seems like you messing up the properties part
of your pom.xml - you use systemProperties instead of properties

it is:
<configuration>
<systemPropertyVariables>

<org.uncommons.reportng.escape-output>false</org.uncommons.reportng.escape-output>
</systemPropertyVariables>
<systemProperties>

....
</systemProperties>
</configuration>

but should be
<configuration>
<systemPropertyVariables>

<org.uncommons.reportng.escape-output>false</org.uncommons.reportng.escape-output>
</systemPropertyVariables>
<properties>
....
</roperties>
</configuration>

according to http://maven.apache.org/plugins/maven-surefire-plugin/examples/testng.html
(last listing on the page)

--
Regards / Pozdrawiam
Tomek Kaczanowski
http://kaczanowscy.pl/tomek

2011/7/28 sabf <s.a...@gmx.de>:

> --
> You received this message because you are subscribed to the Google Groups
> "testng-users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/testng-users/-/yFvbtlhS0JYJ.
> To post to this group, send email to testng...@googlegroups.com.
> To unsubscribe from this group, send email to
> testng-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/testng-users?hl=en.
>

sabf

unread,
Jul 28, 2011, 4:31:44 AM7/28/11
to testng...@googlegroups.com
Hello,

when i try it with the properties tag, than i got that exception:
Running TestSuite
org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException; nested exception is java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
    at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:172)
    at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:104)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:70)
Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String
    at org.testng.TestNG.configure(TestNG.java:1287)
    at org.apache.maven.surefire.testng.conf.TestNGMapConfigurator.configure(TestNGMapConfigurator.java:95)
    at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:119)
    at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
    at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:101)
    ... 9 more

Tomek Kaczanowski

unread,
Jul 28, 2011, 4:38:46 AM7/28/11
to testng...@googlegroups.com
i have seen the same error with some other maven plugin, apparently
they changed the way you specify many listeners

you should try something like

<property>
<name>listener</name>
<values>
<value>org.uncommons.reportng.HTMLReporter</value>
<value>org.uncommons.reportng.JUnitXMLReporter</value>
</values>
</property>

but that is just my guess

--
Regards / Pozdrawiam
Tomek Kaczanowski
http://kaczanowscy.pl/tomek


2011/7/28 sabf <s.a...@gmx.de>:

> --
> You received this message because you are subscribed to the Google Groups
> "testng-users" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/testng-users/-/Wd1uGq8FGMsJ.

sabf

unread,
Jul 28, 2011, 5:21:25 AM7/28/11
to testng...@googlegroups.com
thanks tomek for your suggestion, but i got the same error as above :-(

Tomek Kaczanowski

unread,
Jul 28, 2011, 7:17:07 AM7/28/11
to testng...@googlegroups.com
hm... maybe try downgrade with surefire? right now you use 2.9, try
2.8, 2.7, 2.6 etc.

yeah, still guessing but it has to work somehow

--
Regards / Pozdrawiam
Tomek Kaczanowski
http://kaczanowscy.pl/tomek

2011/7/28 sabf <s.a...@gmx.de>:


> thanks tomek for your suggestion, but i got the same error as above :-(
>

> --
> You received this message because you are subscribed to the Google Groups
> "testng-users" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/testng-users/-/0aTMwZmmjSQJ.

Tomek Kaczanowski

unread,
Jul 28, 2011, 7:28:16 AM7/28/11
to testng...@googlegroups.com
the problem is with testng 5.14 and not with surefire - it is testng
which is complaining

could you upgrade to the current version and check if it works?

--
Regards / Pozdrawiam
Tomek Kaczanowski
http://kaczanowscy.pl/tomek

2011/7/28 Tomek Kaczanowski <kaczanow...@gmail.com>:

Tomek Kaczanowski

unread,
Jul 28, 2011, 7:30:09 AM7/28/11
to testng...@googlegroups.com
try

<?xml version="1.0" encoding="UTF-8"?>
<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>de.edict.edict-testutils.selenium-tests</groupId>
<artifactId>portalseleniumtwo</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>${project.artifactId}</name>

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

<version>6.1</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>
</dependencies>

<build>
<plugins>
<!--Run Testng from Surefire to add results to site docu -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.9</version>
<!-- <artifactId>maven-surefire-plugin</artifactId> -->
<configuration>
<systemPropertyVariables>
<org.uncommons.reportng.escape-output>false</org.uncommons.reportng.escape-output>
</systemPropertyVariables>

<properties>


<property>
<name>usedefaultlisteners</name>
<value>false</value>
</property>
<property>
<name>listener</name>
<value>org.uncommons.reportng.HTMLReporter,
org.uncommons.reportng.JUnitXMLReporter</value>
</property>
<workingDirectory>target/surefire-reports/</workingDirectory>

</properties>
</configuration>
</plugin>
</plugins>
</build>
</project>

2011/7/28 Tomek Kaczanowski <kaczanow...@gmail.com>:

sabf

unread,
Aug 8, 2011, 4:44:13 AM8/8/11
to testng...@googlegroups.com
argh thanks tomek,
Now it works, but i do some other misstake. I forget to add that:
<listeners>
    <listener class-name="org.uncommons.reportng.HTMLReporter" />
  </listeners>
in my testng.xml file

Vijay Goli

unread,
May 4, 2014, 2:01:26 AM5/4/14
to testng...@googlegroups.com
Hi All,
i have set up the pom.xml for reportng. When i run my testng tests i could get the report, but it doesnt show any pass/ fail/skip results. I have added the listeneres tag in the testng.xml file. Here is my pom.xml configurations

<groupId>com.bdd</groupId>
<artifactId>sampletest</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<!-- TODO project name -->
<name>quickstart</name>
<description></description>

<!-- TODO <organization> <name>company name</name> <url>company url</url> 
</organization> -->

<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<distribution>repo</distribution>
</license>
</licenses>

<dependencies>
<!-- WICKET DEPENDENCIES -->

<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket</artifactId>
<version>${wicket.version}</version>
</dependency>
<!-- OPTIONAL <dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket-extensions</artifactId> 
<version>${wicket.version}</version> </dependency> -->

<!-- LOGGING DEPENDENCIES - LOG4J -->

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>

<!-- JUNIT DEPENDENCY FOR TESTING -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.2</version>
<scope>test</scope>
</dependency>

<!-- JETTY DEPENDENCIES FOR TESTING -->

<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>${jetty.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>${jetty.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-management</artifactId>
<version>${jetty.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.1</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>
</dependencies>

<build>
<resources>
<resource>
<filtering>false</filtering>
<directory>src/main/resources</directory>
</resource>
<resource>
<filtering>false</filtering>
<directory>src/main/java</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<testResources>
<testResource>
<filtering>false</filtering>
<directory>src/test/java</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
</plugin>
<properties>
<wicket.version>1.3.2</wicket.version>
<jetty.version>6.1.4</jetty.version>
</properties>

</project>

Can you please let me know where am i going wrong..

Krishnan Mahadevan

unread,
May 4, 2014, 2:53:48 AM5/4/14
to testng...@googlegroups.com
I dont see the suitXmlFile tag at all in your surefire plugin section :

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.9</version>
<!-- <artifactId>maven-surefire-plugin</artifactId> -->
<configuration>
<systemPropertyVariables>
<org.uncommons.reportng.escape-output>false</org.uncommons.reportng.escape-output>
</systemPropertyVariables>
<properties>
<property>
<name>usedefaultlisteners</name>
<value>false</value>
</property>
<property>
<name>listener</name>
<value>org.uncommons.reportng.HTMLReporter,
org.uncommons.reportng.JUnitXMLReporter</value>
</property>
<workingDirectory>target/surefire-reports/</workingDirectory>
</properties>
</configuration>
</plugin>



Can you pls include that and try again ?


Krishnan M
iSent.iPad.
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.

To post to this group, send email to testng...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages