【发布时间】:2022-01-15 02:42:07
【问题描述】:
尝试选择元素进行测试。我们有它的 ID,所以:
@FindBy(how = How.ID, using = "tree-node-home")
WebElement CheckBoxMenuItem;
抛出错误:"element not interactable".
与 XPath 相同或通过 css 选择 [type='checkbox']
试图推迟加载:
WebDriverWait wait = new WebDriverWait(driver, 20);
wait.until(ExpectedConditions.elementToBeClickable(By.id("tree-node-home")));
但这次我得到了
"java: <identifier> expected"
光标在(ExpectedConditions".之前闪烁
什么鬼?
【问题讨论】:
-
当您使用
FluentWait而不是WebDriverWait时是否超时?您可以在pollingEvery(Duration)时初始化它withTimeOut(Duration)并设置,比如说,30 秒超时? -
如果网址是公开的,能发一下吗?