What is the best strategy to handle test case execution when there is a possibility of losing network connectivity during execution? In my case, I have to run 300 test cases which usually take around one hour. It is a waste of time if I find out after an hour that some of my test cases failed due to an intermittent internet issue. I have to check the failed test cases manually, or I have to run the automated tests again, which is inefficient.
In Selenium, how would I detect when a test failed due to a network resource being inaccessible and retry rather than failing? What are good practices for writing durable tests that use network resources?