Skip to content

Commit 0541802

Browse files
committed
Adding appropriate wait to AuthenticatedPageLoadingTest
1 parent 50b8f4c commit 0541802

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import static org.junit.Assert.assertEquals;
2121
import static org.openqa.selenium.support.ui.ExpectedConditions.alertIsPresent;
22+
import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated;
2223
import static org.openqa.selenium.testing.Ignore.Driver.CHROME;
2324
import static org.openqa.selenium.testing.Ignore.Driver.FIREFOX;
2425
import static org.openqa.selenium.testing.Ignore.Driver.HTMLUNIT;
@@ -46,7 +47,8 @@ public void canAuthenticateUsingBasicAuthentication() {
4647

4748
alert.authenticateUsing(user);
4849

49-
assertEquals("authorized", driver.findElement(By.tagName("h1")).getText());
50+
WebElement element = wait.until(presenceOfElementLocated(By.tagName("h1")));
51+
assertEquals("authorized", element.getText());
5052
}
5153

5254
@Test

0 commit comments

Comments
 (0)