Hello.
I'm is using Chrome Web Driver.
Automation test is no problem.
But, I have to test exception case.
Only Internet disconnect test is problem.
[test case]
1. run tmy automation app.
2. turn off wi-fi connection off during normal operation.
3. I saw "ERR_INTERNET_DISCONNECTED "message on chrome browser
4. after 1 minutes. OpenQA.Selenium.WebDriverException is occurred
(As far as I know, The HTTP request to the remote WebDriver timed out after 60 seconds)
5. I caught exception with using try~catch.
But, I can't control chrome web driver.
_driver.Quit(), _driver.Close(), _driver.URL()..etc. No API calls are carried out.
I don't understand, This is basic concept in webdriver or normal operatoin????
We can make this exception case easily. If you meet the same experience, Help me!!!.
Frankly, I'm going to go away.
Additionally, After 5 step, Turn-on wifi, and then current URL reload with using chrome web browser reload menu.
Automation app is running automatically and close at once.
As far as I'm concerned, Dirver api command(_driver.Quit()) in exceptoin was executed after wifi on and reload chrome browser.
If it is true, We can't control chrome web driver Internet disconnect case?
I have a headache for several days.
[code example]
try {
_driver.FindElement(By.XPath(composeXPath)).Click();
}
catch (System.Net.WebException e)
{
System.Diagnostics.Debug.WriteLine("[Web Actor]WebException expired");
}
catch (System.Net.Sockets.SocketException e)
{
System.Diagnostics.Debug.WriteLine("[Web Actor]SocketException expired");
}
catch (NoSuchElementException e)
{
System.Diagnostics.Debug.WriteLine("[Web Actor]No such Element Exception");
}
catch (StaleElementReferenceException e)
{
System.Diagnostics.Debug.WriteLine("[Web Actor]StaleElementReferenceException expired");
}
catch (OpenQA.Selenium.UnhandledAlertException e)
{
System.Diagnostics.Debug.WriteLine("[Web Actor]Unhandled Alert Action");
_driver.SwitchTo().Alert().Accept();
}
catch (OpenQA.Selenium.WebDriverException e)
{
System.Diagnostics.Debug.WriteLine("[Web Actor]Web Driver Try to close");
//Quit,Close,
_driver.Quit();
System.Diagnostics.Debug.WriteLine("[Web Actor]Web Driver Exception");
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine("[Web Actor]Others Exception");
}
Thanks.