Skip to content

Commit fdf34c6

Browse files
committed
Change some tests to use Alert#accept() instead of Alert#dismiss() to get rid
of alert dialogs. This is a workaround to ChromeDriver issue 764: https://code.google.com/p/chromedriver/issues/detail?id=764
1 parent 111a303 commit fdf34c6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

java/client/test/org/openqa/selenium/AlertsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public void testShouldAllowUsersToDismissAnAlertManually() {
122122
wait.until(presenceOfElementLocated(By.id("alert"))).click();
123123

124124
Alert alert = wait.until(alertIsPresent());
125-
alert.dismiss();
125+
alert.accept();
126126

127127
// If we can perform any action, we're good to go
128128
assertEquals("Testing Alerts", driver.getTitle());
@@ -209,7 +209,7 @@ public void testAlertShouldNotAllowAdditionalCommandsIfDismissed() {
209209
driver.findElement(By.id("alert")).click();
210210

211211
Alert alert = wait.until(alertIsPresent());
212-
alert.dismiss();
212+
alert.accept();
213213

214214
try {
215215
alert.getText();

java/client/test/org/openqa/selenium/FormHandlingTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ public void handleFormWithJavascriptAction() {
287287
element.submit();
288288
Alert alert = driver.switchTo().alert();
289289
String text = alert.getText();
290-
alert.dismiss();
290+
alert.accept();
291291

292292
assertEquals("Tasty cheese", text);
293293
}

0 commit comments

Comments
 (0)