Screenshot for failed test case is not getting generated in selenium webdriver

59 Views Asked by At

I have defined the takeScreenshot and ITestListener interfaces in my project. when am trying to run the Test method am getting NullPointerException and .jpg file is not generating.

Can anyone please help me out.s

1

There are 1 best solutions below

0
On

FYI NullPointerException can happen for many reasons.

I would suggest you go over any simple example and double-check what was done wrong or specify the details of your implementation. For example, your public class TestListener implements ITestListener and how you declare it in testng.xml

It will be much easier for us to identify what caused the problem.