Wait Till Text Present In Text Field

前端 未结 6 981
死守一世寂寞
死守一世寂寞 2020-12-05 15:27

In webdriver, how to ask to webdriver to wait until text is present in text field.

actually i have one kendo text field whose values comes from database which takes

6条回答
  •  时光说笑
    2020-12-05 16:14

    You can use a simple method in which you need to pass driver object webelement in which text is going to come and the text which is goint to come.

    public static void waitForTextToAppear(WebDriver newDriver, String textToAppear, WebElement element) {
        WebDriverWait wait = new WebDriverWait(newDriver,30);
        wait.until(ExpectedConditions.textToBePresentInElement(element, textToAppear));
    }
    

提交回复
热议问题