From cdd71e66339dd0c1e3975ab5379f4bbcbd415ad2 Mon Sep 17 00:00:00 2001 From: titusfortner Date: Thu, 5 Oct 2023 21:46:54 -0500 Subject: [PATCH] [py] add synchronization to flaky test --- java/test/org/openqa/selenium/FormHandlingTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/test/org/openqa/selenium/FormHandlingTest.java b/java/test/org/openqa/selenium/FormHandlingTest.java index 3981147789104..918c16fc2eee7 100644 --- a/java/test/org/openqa/selenium/FormHandlingTest.java +++ b/java/test/org/openqa/selenium/FormHandlingTest.java @@ -20,6 +20,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.openqa.selenium.support.ui.ExpectedConditions.alertIsPresent; +import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated; import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs; import static org.openqa.selenium.testing.drivers.Browser.FIREFOX; import static org.openqa.selenium.testing.drivers.Browser.IE; @@ -215,7 +216,7 @@ void testSendingKeyboardEventsShouldAppendTextInInputs() { @NotYetImplemented(SAFARI) public void testSendingKeyboardEventsShouldAppendTextInInputsWithExistingValue() { driver.get(pages.formPage); - WebElement element = driver.findElement(By.id("inputWithText")); + WebElement element = wait.until(presenceOfElementLocated(By.id("inputWithText"))); element.sendKeys(". Some text"); String value = element.getAttribute("value");