Skip to content

Commit

Permalink
[java] IE driver does not allow to execute scripts when an alert (or …
Browse files Browse the repository at this point in the history
…a native dialog?) is open
  • Loading branch information
barancev committed May 2, 2019
1 parent 653da1a commit 0bf27fe
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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)) {
Expand All @@ -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();
}
Expand Down

0 comments on commit 0bf27fe

Please sign in to comment.