RE: How to handle failed script

Hi Virender/All,

In any case if test script gets failed how to handle this situation means how to take care of script failure handler.

Add Comment
2 Answers

Hi Ravi,

This is a very subjective question here, you can handle script failure in lot of ways. I cannot give you code for this as it is very specific to what you want to achieve.

– Usually your script failure handler is either event driven or is a part of the Test runner.
– You can handle the failure by reporting it first and then marking it for a rerun.
РIf you are using testng as your framework, you may want to tap in the ITestListener interface of TestNg. It has two methods, OntestFaliure and OnTestSkipped. You can write the code to take action son failure and skip in these methods.


Professor Answered on April 24, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.