【发布时间】:2022-01-28 14:27:00
【问题描述】:
我的场景是
- 在文本框中输入值。
- 点击清除按钮。
- 等到文本框清除。
【问题讨论】:
-
我可以使用线程。睡觉,但我不想用它。
-
尝试使用带有显式等待的
textMatches。匹配空/空字符串 -
使用 wait.until(ExpectedConditions.textToBePresentInElement(webelement, ""));但问题还是一样。
-
按照建议尝试使用 textMatches
-
org.openqa.selenium.support.ui.ExpectedConditions中的任何一个在调用时都必须为 false,否则会抛出org.openqa.selenium.TimeoutException。
标签: java selenium selenium-webdriver