Mix*_*Mix 16 java selenium selenium-chromedriver selenium-webdriver
在我的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>
Run Code Online (Sandbox Code Playgroud)
除此之外,我的测试工作正常。我以前从未遇到过类似的问题。我也试图找到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);
Run Code Online (Sandbox Code Playgroud)
我的自动化脚本应该找到PDF元素并向下滚动页面。相反,我收到此错误:org.openqa.selenium.TimeoutException:等待90秒后等待By.id定位的元素的可见性超时:插件
有人面临类似的问题吗?提前致谢。
我遇到了同样的问题。
Chrome显然会自动更新。昨天(19年10月29日),我的ChromeDriver开始抱怨它与Chrome 78不兼容。我将驱动程序更新为78版本。尝试查找我确认存在的元素时,我开始随机获得org.openqa.selenium.NoSuchElementException异常。当我使用断点时,findElement [s]也可以工作。我还尝试了隐式等待,但仅获得了有限的成功。
我尝试了zsbappa的ChromeOption解决方案,但没有任何乐趣。
Google很难获取旧版本的Chrome,但我在https://www.neowin.net/news/google-chrome-76-offline-installer/上找到了76版。当心,在线安装程序会安装最新版本。我回到了76位司机,一切都很好。我所有的硒测试都重新开始了。
我的结论是,Chrome 78及其相关的驱动程序处于竞争状态,Selenium尝试在完成之前查询该网页。
| 归档时间: |
|
| 查看次数: |
3813 次 |
| 最近记录: |