extent-framework / extentreports-testng-adapter

TestNG Adapter for Extent Framework
http://extentreports.com/docs/versions/4/java/testng.html
Apache License 2.0
50 stars 14 forks source link

ExtentITestListenerClassAdapter throws error #14

Closed sseenivasan89 closed 4 years ago

sseenivasan89 commented 4 years ago

I have added ExtentITestListenerClassAdapter listener (below line) to my testng-xml suite file and when i ran got error (last line) listener class-name="com.aventstack.extentreports.adapter.listener.ExtentITestListenerClassAdapter" i just added extentreports-testng-adapter dependency to pom file and placed both extent.properties and config.xm file in src/test/resources folder, am i missing anything ?

**Error : Listener com.aventstack.extentreports.adapter.listener.ExtentITestListenerClassAdapter was not found in project's classpath**

anshooarora commented 4 years ago

@sseenivasan89 Can you create a small repo and share? There is an example here which you can refer to as well.

sseenivasan89 commented 4 years ago

Hi Sir, i was able to get report when i run test from class file since i used @Listeners in class file, but if i add @Listeners in testng.xml file and try to run, getting below error and here is the repo which i tried

Error : Listener Extent.Adapter.ExtentIReporterSuiteClassAdapter was not found in project's classpath

anshooarora commented 4 years ago

Thanks for pointing this one out, I was able to reproduce and the path to the listener was invalid. You can use any one of below (with the correct package name):

<listeners>
  <listener class-name="com.aventstack.extentreports.testng.listener.ExtentITestListenerClassAdapter" />
</listeners>

<listeners>
  <listener class-name="com.aventstack.extentreports.testng.listener.ExtentITestListenerAdapter" />
</listeners>

<listeners>
  <listener class-name="com.aventstack.extentreports.testng.listener.ExtentIReporterSuiteClassListenerAdapter" />
</listeners>

<listeners>
  <listener class-name="com.aventstack.extentreports.testng.listener.ExtentIReporterSuiteListenerAdapter" />
</listeners>
sseenivasan89 commented 4 years ago

Thanks @anshooarora sir now i able to run successfully 👍