WebDriver: how to wait for text to disappear in the element

后端 未结 1 2049
温柔的废话
温柔的废话 2020-12-21 14:49

I have a field that dynamically changes it\'s text. I need a way to wait for the text to be changed. I\'m not aware about what text will appear, but I know what text is curr

1条回答
  •  别那么骄傲
    2020-12-21 15:14

    You can Try ExpectedConditions function textToBePresentInElement and add a not, like,

    WebDriverWait wait = new WebDriverWait(driver, 30);
    WebElement element = driver.findElement(By.id("foo"));
    wait.until(ExpectedConditions.not(
        ExpectedConditions.textToBePresentInElement(element,"textToBePresent")));
    

    0 讨论(0)
提交回复
热议问题