在 webdriver 中,如何要求 webdriver 等到文本出现在文本字段中。
实际上我有一个剑道文本字段,其值来自需要一些时间加载的数据库。加载后,我可以继续进行。
请帮忙解决这个问题
最佳答案
您可以使用 WebDriverWait。来自文档示例:
(new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver d) {
return d.findElement(...).getText().length() != 0;
}
});
关于java - 等到文本出现在文本字段中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15656252/