I have an application in selenium of c # but during the execution it can happen that it is without internet connection. so I did it this way:
try{
driver2.Navigate().Refresh();
}catch(Exception ex){
Console.WriteLine(ex.Message);
}
Perole removes the internet physically from the team, the page refreshes, appears timeOut and goes through the try but does not throw any exception. How do I capture that error that there is no connection to the page?