0

Getting java.lang.NoClassDefFoundError error when running xml file using testng. Error details: java.lang.NoClassDefFoundError: Could not initialize class com.listeners.ExtentTestManager at com.listeners.Listeners.onTestFailure(Listeners.java:56)

I am using testng version 6.9.10 in pom.xml.

Hi, I am getting this error when I use listeners in my xml file. If I remove listeners and run the xml file, it is working. Please let me know if anything wrong with ExtentTestManager class or the dependencies. I am unable to add code in stackoverflow, so I have attached in this link: selenium99.com/java-lang-noclassdeffounderror Pls check.

Thanks in advance.

Suresh
  • 59
  • 1
  • 4
  • `com..listeners.ExtentTestManager` you have two dots after the 'com' – bugsb Aug 19 '19 at 10:23
  • Could you provide a code in what the Error occupies? – Blind Kai Aug 19 '19 at 10:33
  • In your case, the problem in an earlier class initialization failure. Some of the answers in the linked Q&A explain that. – Stephen C Aug 19 '19 at 11:16
  • Hi, I am getting this error when I use listeners in my xml file. If I remove listeners and run the xml file, it is working. Please let me know if anything wrong with ExtentTestManager class or the dependencies. I am unable to add code in stackoverflow, so I have attached in this link: https://selenium99.com/java-lang-noclassdeffounderror/ Pls check. – Suresh Aug 19 '19 at 12:42
  • My issue was resolved after doing below two things. 1. Added Logs/generatedLogs.html folder in LatestResults folder. 2. Added resources/extent-config.xml under C:\Users\username\.m2\repository\com\relevantcodes\extentreports – Suresh Aug 29 '19 at 18:24

0 Answers0