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

SKIP Exception if used in @BeforeSuite - throws null pointer exception #2

Closed ghost closed 5 years ago

ghost commented 5 years ago

LearnTestNG.zip

If we use SKIP Exception in the @BeforeSuite then ITestListener throws null pointer exception, also all the test skips and executed(failed), so we can see the entry as Test1 (skipped) and Test1(Failed).

anshooarora commented 5 years ago

@sen1983 thank you, I am able to reproduce.

ghost commented 5 years ago

Hi Anshoo,

Still we are getting the same issue, Please include @BeforeSuite with Skip Exception in Class1 and when executed throws null pointer exception. extentreports-testng-adapter-master.zip

exception

anshooarora commented 5 years ago

Ok, so the same issue within onTestFailure. What baffles me is that getThrowable() is null on both skipped and failure. I will push the fix in a few mins.

ghost commented 5 years ago

Hi Anshoo,

I was the facing the same exception again but later identified the root cause. Actually I am using TestNG 6.14.3 eclipse plugin. Then I have downgraded the TestNG version to 6.9.10 and it is working fine.

Also I have noticed the below exception while debug use TestNG 6.14.3 "org.eclipse.debug.core.DebugException: com.sun.jdi.ClassNotLoadedException: Type has not been loaded occurred while retrieving component type of array."

Additional information: First it skips the failClass1 test and again its trying to execute and get failed , in this point we are getting the above exception seems which got suppressed. Also if I don't use any of the listener its working fine.

Its very weird to see why the same test trying to skip and execute.

Could you please fix the same for the latest version of the TestNG 6.14.3?

Thanks Senthil exception

anshooarora commented 5 years ago

I am unable to reproduce using testng:6.14.3 with the last commit.

ghost commented 5 years ago

Hi Anshoo,

Its not working, believe me still this issue exists with ITestListener. Attached the project below i have included only ITestListener listener alone for testing.

TestNGAdapter.zip

I have just added Skip exception in beforesuite and a new test for skip exception. Please check it and let me know if anything I did wrong in the code.

Same test case skips and fails, while failing its throwing null, I am not sure why the same test case is looping. Please find the screenshot

exception

anshooarora commented 5 years ago

Please try with the attached:

TestNGAdapter.zip

ghost commented 5 years ago

Thanks for the update, now its executing fine, but the report is incorrect, so raising new issue.