Forum Discussion
Not exactly a re-run, but I would write a loop at the beginning of every test case to perform the following steps
1) Check to see if we are connecting
2) Wait to see if the connecting status goes away within a minute
3) If it doesn't go away, kill the application and restart the application
4) If it does go away, continue with the test
5) loop 2-4 in a while loop checking each time through the loop. I'd put a counter in the loop condition as well to limit it that, if it retries more than a certain number of times, mark the test case as failed and move to the next.
Just as a side note... if the application is getting caught in a "connecting" state and it's not an artifact of the test automation, I'd raise a bug to my developers to let them know. Personally, I'd rather not write test automation to work around bugs but let the test automation report bugs. You've found a bug with your automation... it did what it was supposed to do. It's up to the developers to fix it. :) Just my $0.02 US and, in this economy, that might not be worth a lot.
Unfortunately, it is not as straigtforward as it appeared to you...
It is not a developers' issue. They are aware of it. And the issue is not stable in arising. Physical machine does not face it. Win 10 virtual machine faces it rarely... But Win7 and Win8 VMs - that happens a lot.
The issue does not appear in the beginning of a test only. It may appear after any step that results in changing connection status. Many steps may have been performed prior to that.
So simple restarting the app does not work here. I need to start the test from the beginning. And continue the suite.