【发布时间】:2018-09-25 13:22:37
【问题描述】:
下面是我的元素;
String sId = driver.findElement(By.xpath(path)).getAttribute("data-id");
由于现在属性值存储在“sId”中,我现在需要告诉 Selenium 等到 data-id 属性值 不等于 到 sID。 我试过下面的代码没有运气:
wait.until_not(ExpectedConditions.textToBePresentInElement(By.xpath(path), sId));
我得到错误:
方法 until_not(ExpectedCondition) 未定义 键入 WebDriverWait
即使我将“until_not”更改为“until”,我也会收到以下警告:
来自类型的方法 textToBePresentInElement(By, String) ExpectedConditions 已弃用
我该怎么做?
【问题讨论】:
-
等到 data-id attribute
value is NOT equal to sID将是误报。 IMO,如果 usecase 允许,您应该等待value is equal to sID
标签: java selenium selenium-webdriver webdriver selenium-chromedriver