Search code examples
seleniumwebdrivertestngevent-listener

Getting error while taking screenshots only for failed test cases using listeners


enter image description here

above attached is the test class.. which is getting failed.

enter image description here This is a utility class for Listener

enter image description here This is a utility to take Screenshots

enter image description here This is BaseClass utility. which i have created to provide complete WebDriver Methods to Listeners class.

enter image description here This is the result (console) which is showing after runnig the test.

enter image description here

Tests are neither getting failed nor getting passed.


Solution

  • In LoginPageTest class, comment the line 'WebDriver driver;' and try, because you are extending the driver instance from BaseClass.