Skip to content

Commit c95184a

Browse files
committed
deflaking test the intermittently fails in travis
1 parent 3b7ba0e commit c95184a

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,8 @@ private void runScenarioWithUnhandledAlert(UnexpectedAlertBehaviour behaviour,
122122
private void runScenarioWithUnhandledAlert(String expectedAlertText) {
123123
driver2.get(pages.alertsPage);
124124
driver2.findElement(By.id("prompt-with-default")).click();
125-
try {
126-
driver2.findElement(By.id("text")).getText();
127-
} catch (UnhandledAlertException expected) {
128-
}
129125

130-
new WebDriverWait(driver2, 30).until(elementTextToEqual(By.id("text"), expectedAlertText));
126+
new WebDriverWait(driver2, 30).ignoring(UnhandledAlertException.class).until(elementTextToEqual(By.id("text"), expectedAlertText));
131127
}
132128

133129
}

0 commit comments

Comments
 (0)