Re: [selenium-users] Getting error Failed to generate HTML Report by use of ReportNG with Maven.

447 views
Skip to first unread message
Message has been deleted

Krishnan Mahadevan

unread,
May 20, 2013, 10:46:50 PM5/20/13
to testng...@googlegroups.com
Omkar,
The exception 

org.uncommons.reportng.ReportNGUtils threw exception class java.lang.NoSuchMethodError : org.testng.ITestContext.
getPassedConfigurations()Lorg/testng/IResultMap;


Suggests that you have a ReportNG vs TestNG dependency conflict. 
One of the below is true:
1. ReportNG is using a TestNG method that got removed in 6.1.1 (or)
2. ReportNG is using a TestNG method that was added as part of a newer version and doesn't exist in TestNG 6.1.1. 

Have you tried referring to the ReportNG documentation to check what version of TestNG does it require ?

On Sunday, May 19, 2013, Omkar Khatavkar wrote:
Hi guys,

I am trying to generate HTML report using Maven with ReportNG.I ahd mention the pom.xml file below.Please some one can help me out.I am new to maven and ReportNG.

Error:

Running TestSuite
org.apache.maven.surefire.
booter.SurefireExecutionException: Failed generating HTML report.; nested exception is
org.uncommons.reportng.ReportNGException: Failed generating HTML report.
org.uncommons.reportng.ReportNGException: Failed generating HTML report.
        at org.uncommons.reportng.HTMLReporter.generateReport(HTMLReporter.java:117)
        at org.testng.TestNG.run(TestNG.java:613)
        at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:62)
        at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:102)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:109)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
        at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1017)
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getDuration' in  class
org.uncommons.reportng.ReportNGUtils threw exception class java.lang.NoSuchMethodError : org.testng.ITestContext.
getPassedConfigurations()Lorg/testng/IResultMap;
        at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:246)
        at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:175)



My Pom.xml is below

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.reportng</groupId>
    <artifactId>Reportng</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

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

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.1.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.31.0</version>
        </dependency>
        <dependency>
            <groupId>org.uncommons</groupId>
            <artifactId>reportng</artifactId>
            <version>1.1.2</version>
        </dependency>
        <dependency>
            <groupId>velocity</groupId>
            <artifactId>velocity</artifactId>
            <version>1.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <version>3.0</version>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <id>java-
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.
Visit this group at http://groups.google.com/group/testng-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

Omkar Khatavkar

unread,
May 21, 2013, 1:45:21 AM5/21/13
to testng...@googlegroups.com
Hi Krishnan ,

Thanks for reply,

I did solve the problem,you were wright i was messed up with pom.xml

below pom.xml worked for me
 
<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.reportng</groupId>
    <artifactId>Reportng</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

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

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.uncommons</groupId>
            <artifactId>reportng</artifactId>
            <version>1.1.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.1.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.31.0</version>
        </dependency>
        <dependency>
            <groupId>velocity</groupId>
            <artifactId>velocity</artifactId>
            <version>1.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <version>3.0</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.5</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>
                    <workingDirectory>target/</workingDirectory>
                    <forkMode>always</forkMode>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>




--
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.
Visit this group at http://groups.google.com/group/testng-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Thanks and Regards,
 Omkar Khatvakar

Omkar Khatavkar

unread,
May 25, 2013, 2:56:02 AM5/25/13
to testng...@googlegroups.com
I did added class path but still getting error as

E:\Omkar\AutomationAtHome\DeskeraApps>java org.testng.TestNG testng.xml
Exception in thread "main" java.lang.NoClassDefFoundError: com/beust/jcommander/
ParameterException
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.getMethod0(Unknown Source)
        at java.lang.Class.getMethod(Unknown Source)
        at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.beust.jcommander.ParameterExcep
tion
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 6 more

Omkar Khatavkar

unread,
May 25, 2013, 2:56:56 AM5/25/13
to testng...@googlegroups.com
sorry for last wrong thread

Reply all
Reply to author
Forward
0 new messages