Re: [webdriver] Whenver i am running my testng.xml from pom.xml i am getting the below described error

1,073 views
Skip to first unread message
Message has been deleted

⇜Krishnan Mahadevan⇝

unread,
Jan 16, 2017, 10:53:01 PM1/16/17
to webdriver
Akash,

This question is NOT related to Selenium WebDriver. Its more of a TestNG question. I would suggest that you please post TestNG queries here.

Answering your question.. doesn't the below stacktrace tell you what the issue is ? TestNG is basically complaining that it cannot find a class by name "customListeners.CustomListeners" anywhere in your CLASSPATH. Please make sure you have referred to the correct class name in your suite xml file



[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project suzukimotorcycle: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: There was an error in the forked process
[ERROR] org.testng.TestNGException:
[ERROR] 
[ERROR] Listener customListeners.CustomListeners was not found in project's classpath
[ERROR] at org.testng.TestNG.initializeConfiguration(TestNG.java:977)
[ERROR] at org.testng.TestNG.run(TestNG.java:1089)






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/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Tue, Jan 17, 2017 at 9:19 AM, Akash Srivastava <srivastav...@gmail.com> wrote:
Can anyone please tell what is the issue here

Below is my testng.xml 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite">
  
  <listeners>
    <listener class-name="customListeners.CustomListeners" />
     <listener class-name="org.uncommons.reportng.HTMLReporter"/>
      <listener class-name="org.uncommons.reportng.JUnitXMLReporter"/>
    
  </listeners>
 
  <test name="HomePage Test">
  <parameter name="browser" value="FF"/>
    <classes>
      <class name="co.in.suzukimotorcycle.testcases.HomePageTestCase_01"/>
    
    </classes>
  </test> <!-- Test -->
  
</suite> <!-- Suite -->

**************************************************************************************************************
below is my pom.xml
<modelVersion>4.0.0</modelVersion>
<groupId>co.in</groupId>
<artifactId>suzukimotorcycle</artifactId>
<version>0.0.1-SNAPSHOT</version>


<dependencies>


<dependency>
<groupId>org.uncommons</groupId>
<artifactId>reportng</artifactId>
<version>1.1.4</version>
</dependency>

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


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

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.10</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<version>4.11</version>
</dependency>

<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>


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

<!-- Dependency for POI API -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.6</version>
</dependency>

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.6</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.1</version>
</dependency>

<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.3.0</version>
</dependency>

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.6</version>
</dependency>

<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>common-java5</artifactId>
<version>2.16</version>
</dependency>
</dependencies>




<build>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<testFailureIgnore> false </testFailureIgnore>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/runner/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>





</plugin>


</plugins>
</build>



</project>
***********************************************************************************************************************************************************

below is the error which i am getting
please let me know if you need any other info



[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building suzukimotorcycle 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.testng:testng:jar:5.14.3 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.testng:testng:jar:5.14.4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.testng:testng:jar:5.14.5 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ suzukimotorcycle ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ suzukimotorcycle ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ suzukimotorcycle ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ suzukimotorcycle ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 9 source files to E:\Maven\WorkSpace\suzukimotorcycle\target\test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ suzukimotorcycle ---

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running TestSuite

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.085 s
[INFO] Finished at: 2017-01-17T09:09:27+05:30
[INFO] Final Memory: 20M/168M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project suzukimotorcycle: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: There was an error in the forked process
[ERROR] org.testng.TestNGException:
[ERROR] 
[ERROR] Listener customListeners.CustomListeners was not found in project's classpath
[ERROR] at org.testng.TestNG.initializeConfiguration(TestNG.java:977)
[ERROR] at org.testng.TestNG.run(TestNG.java:1089)
[ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:281)
[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:121)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+unsubscribe@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at https://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/d/optout.

Akash Srivastava

unread,
Jan 16, 2017, 11:01:09 PM1/16/17
to webdriver
Hi Krishnan

Thanks and it worked i was not seeing that part of code
Reply all
Reply to author
Forward
0 new messages