I have a selenium automated task setup to login to a website to retrieve some information. It's very basic in the automation. Just logging in and clicking two links. I am running into an issue that is proving to be a problem.
The site in question uses the Authentication Required popup which is not a javascript popup but rather the regular windows auth popup. From what I have read this isn't handled out of the box with selenium.
I am using the "http://Username:Password@url.com" to get to the site but every now and then the site itself has issues on their end where it will prompt me again from username/password randomly. Sometimes I have to enter the username/password twice in a row when navigating there by hand.
Since my task just loops continuously for a few hours picking up the needed info I figured I would just use WebDriverWait to verify an element is present on the page. If the authentication popup appears, the element isn't present. No need to care about this run, so just start over.
The problem I am having is that when the Authentication popup is displayed and I hit my timeout limit I want to close the driver/browser window so that I can start the task over again. However, driver.Close() and driver.Quit() are not doing anything. The browser remains open and the unloaded page is still there with the login popup.
Is there anyway I can force close this? Switch focus to the browser window then force close?