jnicklas/capybara — pull request #1252 by klinden (2014-02-18 19:39:49+00:00)
Title: Handle onbeforeunload dialog during session reset

During session reset in the Selenium driver if the page being tested had an onbeforeunload dialog, navigating to about:blank would cause this dialog to display. There was no way to handle this so a Selenium::WebDriver::Error::UnhandledAlertError would occur. This patch switches to the alert (if it is present) and accepts it so that the error doesn't occur.