为什么硒“等待”不一致?

时间:2016-01-28 11:52:05

标签: scala selenium selenium-webdriver webdriver

我有一些webelement(文本字段),我正在用wait观看,因为我想发送一些密钥。

Tt看起来像这样:

   val wait: WebDriverWait = new WebDriverWait(driver, 120)
   wait.until(ExpectedConditions.elementToBeClickable(By.id("invoice_supplier_name")))
        val supplierTextField: WebElement = driver.findElement(By.id("invoice_supplier_name"))
        supplierTextField.clear()
        supplierTextField.sendKeys(invoice.supplierName)

但有时它没关系,有时我会收到错误“元素不可见”

有人知道为什么会这样吗?

感谢

0 个答案:

没有答案