Chromedriver 78可能存在的问题,Selenium无法找到在Chrome中打开的PDF的Web元素

问题描述 投票:0回答:2

直到我的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&amp;reanudar=&amp;>
</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。因此,我再也无法使用...

java selenium selenium-webdriver selenium-chromedriver testng
2个回答
0
投票

通过添加以下参数,我已经解决了我的问题。


0
投票

例如:您可以尝试使用此关键字!。

© www.soinside.com 2019 - 2024. All rights reserved.