In this post I will show you how to capture screen shot of failed test using exception handling and test marked failed in report.
In below example I handle exception using try catch block and call capture screen shot function in catch section, then throws exception make test fail.
In below example I handle exception using try catch block and call capture screen shot function in catch section, then throws exception make test fail.