How to handle failed script
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.
That`s correct Virender,
If the script gets failed then we are required to perform the following :
1. Report the failure script
2. call the handler
3. once framework executed as a whole then rerun the framework for failed scripts as a whole again
Could you pass the code or any help on point 1 & 2.