You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.
If a page would open a beforeUnload dialog when closing, the InternetExplorerDriver.close()
command attempts to close the browser and then throws an exception for any other commands
sent to the browser. The browser with the dialog is left open.
Using the sample HTML:
<html><body>
<script>
window.onbeforeunload = function() {
return 'You have unsaved changes!';
}
</script>
</body></html>
Run code like the following:
driver.get("<url-to-sample-page>");
driver.close();
WebDriverWait wait = new WebDriverWait(driver, 2);
wait.until(ExpectedConditions.alertIsPresent());
driver.switchTo().alert().accept();
Expected behavior:
All lines of code should run, no exception should be thrown. The dialog should be accepted
and the browser should then close.
Actual behavior:
An exception is thrown when trying to test if the alert is present:
org.openqa.selenium.remote.SessionNotFoundException: session 30ecd2a6-b8bd-4eff-bd2e-57b803a61bdd
does not exist
Command duration or timeout: 0 milliseconds
The browser is left open with the dialog showing.
Selenium version: 2.42.2
OS: WebKing 7 64-bit (Windows NT 6.1 SP1 x86_64)
Browser: Internet Explorer
Browser version: 11.0.9600.17280
Reported by para.selenium.bugs on 2014-09-15 10:01:18
The text was updated successfully, but these errors were encountered:
Originally reported on Google Code with ID 7895
Reported by
para.selenium.bugs
on 2014-09-15 10:01:18The text was updated successfully, but these errors were encountered: