Fixing flakiness in waiting for a text
import static org.openqa.selenium.support.ui.ExpectedConditions.frameToBeAvailableAndSwitchToIt;
import static org.openqa.selenium.support.ui.ExpectedConditions.not;
import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated;
+import static org.openqa.selenium.support.ui.ExpectedConditions.textToBe;
import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs;
import static org.openqa.selenium.testing.Driver.CHROME;
import static org.openqa.selenium.testing.Driver.HTMLUNIT;
@@ -298,7 +299,7 @@ public void testShouldContinueToReferToTheSameFrameOnceItHasBeenSelected() {
// TODO(simon): this should not be needed, and is only here because IE's submit returns too
// soon.
- wait.until(WaitingConditions.elementTextToEqual(By.xpath("//p"), "Success!"));
+ wait.until(textToBe(By.xpath("//p"), "Success!"));
}
@Test
