Null pointer exception in Listener class when test gets skipped | Selenium Forum
V
Vishal Posted on 18/08/2020

Hello,

As showing in 'TestNG - Raw Project Structure, Running of Tests, Report Generation - LIVE PROJECT' > video 2

I have created a Listener class, in which I did code the same way shown in the video, But when any dependent test gets skipped due to parent test cases got failed I observed Null pointer exception at the line "test.log(Status.SKIP, result.getName() + " is Skipped");"

So I did use debugger to check and found out in case test is skipped by testNG then result object contains null thats why it is showing null pointer exception. And also that skipped test record is not getting captured in Extent Report.

Is there any to solve this. Please do let me know. Thanks!


A
Ashish Thakur Replied on 19/08/2020

Send us your code

Some wrong configuration is there