Skip to content

Commit

Permalink
Change some tests to use Alert#accept() instead of Alert#dismiss() to…
Browse files Browse the repository at this point in the history
… get rid

of alert dialogs. This is a workaround to ChromeDriver issue 764:

https://code.google.com/p/chromedriver/issues/detail?id=764
  • Loading branch information
jleyba committed May 6, 2014
1 parent 111a303 commit fdf34c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions java/client/test/org/openqa/selenium/AlertsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void testShouldAllowUsersToDismissAnAlertManually() {
wait.until(presenceOfElementLocated(By.id("alert"))).click();

Alert alert = wait.until(alertIsPresent());
alert.dismiss();
alert.accept();

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

Alert alert = wait.until(alertIsPresent());
alert.dismiss();
alert.accept();

try {
alert.getText();
Expand Down
2 changes: 1 addition & 1 deletion java/client/test/org/openqa/selenium/FormHandlingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public void handleFormWithJavascriptAction() {
element.submit();
Alert alert = driver.switchTo().alert();
String text = alert.getText();
alert.dismiss();
alert.accept();

assertEquals("Tasty cheese", text);
}
Expand Down

0 comments on commit fdf34c6

Please sign in to comment.