直到我的Google Chrome浏览器没有更新到版本78,我的代码才能正常工作。我还将chromedriver更新为版本78.0.3904.70。因此,我无法再使用Selenium WebDriver和Java查找id ='plugin'的WebElement:
<html> <div id="content"> <embed id="plugin" type="application/x-google-chrome-pdf" src="http://??????????/offer_printed.php?printable=yes&reanudar=&> </div> </html>
除了那部分,我的测试工作正常。我以前从未遇到过类似的问题。我也试图找到WebElement id ='content',但是我收到了同样的错误。
WebDriverWait wait = new WebDriverWait (driver, 90); WebElement scrollvalid = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("plugin"))); scrollvalid.sendKeys(Keys.PAGE_DOWN); scrollvalid.sendKeys(Keys.PAGE_DOWN);
我的自动化脚本应找到PDF元素并向下滚动页面。相反,我收到此错误:org.openqa.selenium.TimeoutException:等待90秒后等待By.id所定位元素的可见性:插件
有人面临类似的问题吗?预先感谢。
直到我的Google Chrome浏览器没有更新到版本78,我的代码才能正常工作。我还将chromedriver更新为版本78.0.3904.70。因此,我再也无法使用...
通过添加以下参数,我已经解决了我的问题。
例如:您可以尝试使用此关键字!。