[java] IE driver does not allow to execute scripts when an alert (or a native dialog?) is open
@@ -228,6 +228,7 @@ public void testClickingOnAButtonThatClosesAnOpenWindowDoesNotCauseTheBrowserToH
public void testCanCallGetWindowHandlesAfterClosingAWindow() throws Exception {
assumeFalse(Browser.detect() == Browser.OPERA &&
TestUtilities.getEffectivePlatform().is(Platform.WINDOWS));
+ boolean isNewIE = isInternetExplorer(driver) && !isIe6(driver);
driver.get(pages.xhtmlTestPage);
@@ -239,6 +240,7 @@ public void testCanCallGetWindowHandlesAfterClosingAWindow() throws Exception {
driver.switchTo().window("result");
int allWindowHandles = driver.getWindowHandles().size();
+ assertThat(allWindowHandles).isEqualTo(currentWindowHandles.size() + 1);
// TODO Remove sleep when https://bugs.chromium.org/p/chromedriver/issues/detail?id=1044 is fixed.
if (TestUtilities.isChrome(driver) && TestUtilities.getEffectivePlatform(driver).is(ANDROID)) {
@@ -247,7 +249,7 @@ public void testCanCallGetWindowHandlesAfterClosingAWindow() throws Exception {
wait.until(ExpectedConditions.presenceOfElementLocated(By.id("close"))).click();
- if (isInternetExplorer(driver) && !isIe6(driver)) {
+ if (isNewIE) {
Alert alert = wait.until(alertIsPresent());
alert.accept();
}
