<legend id='fhVvM'><style id='fhVvM'><dir id='fhVvM'><q id='fhVvM'></q></dir></style></legend>

      • <bdo id='fhVvM'></bdo><ul id='fhVvM'></ul>

      <small id='fhVvM'></small><noframes id='fhVvM'>

      <i id='fhVvM'><tr id='fhVvM'><dt id='fhVvM'><q id='fhVvM'><span id='fhVvM'><b id='fhVvM'><form id='fhVvM'><ins id='fhVvM'></ins><ul id='fhVvM'></ul><sub id='fhVvM'></sub></form><legend id='fhVvM'></legend><bdo id='fhVvM'><pre id='fhVvM'><center id='fhVvM'></center></pre></bdo></b><th id='fhVvM'></th></span></q></dt></tr></i><div id='fhVvM'><tfoot id='fhVvM'></tfoot><dl id='fhVvM'><fieldset id='fhVvM'></fieldset></dl></div>

        <tfoot id='fhVvM'></tfoot>
      1. Chromedriver 78 可能存在问题,Selenium 找不到在 Chrome 中打开的 PDF 的 Web 元

        时间:2023-06-27
          <tbody id='v4fZh'></tbody>
        1. <small id='v4fZh'></small><noframes id='v4fZh'>

            <tfoot id='v4fZh'></tfoot>
          1. <i id='v4fZh'><tr id='v4fZh'><dt id='v4fZh'><q id='v4fZh'><span id='v4fZh'><b id='v4fZh'><form id='v4fZh'><ins id='v4fZh'></ins><ul id='v4fZh'></ul><sub id='v4fZh'></sub></form><legend id='v4fZh'></legend><bdo id='v4fZh'><pre id='v4fZh'><center id='v4fZh'></center></pre></bdo></b><th id='v4fZh'></th></span></q></dt></tr></i><div id='v4fZh'><tfoot id='v4fZh'></tfoot><dl id='v4fZh'><fieldset id='v4fZh'></fieldset></dl></div>

                <bdo id='v4fZh'></bdo><ul id='v4fZh'></ul>
                <legend id='v4fZh'><style id='v4fZh'><dir id='v4fZh'><q id='v4fZh'></q></dir></style></legend>

                  本文介绍了Chromedriver 78 可能存在问题,Selenium 找不到在 Chrome 中打开的 PDF 的 Web 元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在我的谷歌浏览器没有更新到版本 78 之前,我的代码运行良好.我还将 chromedriver 更新到版本 78.0.3904.70.所以我再也无法使用 Selenium WebDriver 和 Java 找到 id='plugin' 的 WebElement:

                  Until my google Chrome wasn't updated to version 78 my code worked fine. I also updated the chromedriver to version 78.0.3904.70. So I am not able anymore to find WebElement with id='plugin' using Selenium WebDriver and Java:

                  <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' 但我收到了同样的错误.

                  Other than that part my tests are working fine. I never had a similar issue before. I also tried to find WebElement id='content' but I am receiving the same error.

                  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 定位的元素的可见性:插件

                  My automation script should find the PDF element and scroll the page down. Instead, I am receiving this error: org.openqa.selenium.TimeoutException: Timed out after 90 seconds waiting for visibility of element located by By.id: plugin

                  有人遇到过类似的问题吗?提前致谢.

                  Is anybody facing a similar issue? Thanks in advance.

                  推荐答案

                  我也遇到了同样的问题.

                  I've run into the same issue.

                  显然 Chrome 会自动更新.昨天(2019 年 10 月 29 日)我的 ChromeDriver 开始抱怨它与 Chrome 78 不兼容.我将驱动程序更新到 78 版本.在尝试查找我确认存在的元素时,我开始随机出现 org.openqa.selenium.NoSuchElementException 异常.当我使用断点时, findElement[s] 也可以工作.我也尝试过隐式等待,但效果有限.

                  Apparently Chrome automatically updates itself. Yesterday (Oct 29 '19) My ChromeDriver started complaining that it was not compatible with Chrome 78. I updated the driver to the 78 version. I started to get random org.openqa.selenium.NoSuchElementException exceptions when trying to find elements that I confirmed were there. The findElement[s] also work when I used breakpoints. I also tried implicit waits, with only limited success.

                  我尝试了 zsbappa 的 ChromeOption 解决方案,但没有任何乐趣.

                  I tried zsbappa's ChromeOption solution but no joy.

                  Google 很难获得旧版本的 Chrome,但我在 https://www.neowin.net/news/google-chrome-76-offline-installer/.请注意,在线安装程序会安装最新版本.我恢复了 76 的驱动程序,一切都很好.我所有的 Selenium 测试都重新开始工作了.

                  Google makes it hard to get old versions of Chrome, but I found version 76 at https://www.neowin.net/news/google-chrome-76-offline-installer/. Beware, the online installer installs the latest version. I reverted to the driver for 76 and all is good. All my Selenium tests are working again.

                  我的结论是 Chrome 78 及其相关驱动程序存在竞争条件,即 Selenium 会在网页完成之前尝试询问网页.

                  My conclusion is that the Chrome 78 and it's associated driver has a race condition where Selenium attempts to interrogate the web page before it's complete.

                  这篇关于Chromedriver 78 可能存在问题,Selenium 找不到在 Chrome 中打开的 PDF 的 Web 元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 Ubuntu Server 上无头运行 Chromedriver 下一篇:如何在 Selenium 中获取 WebElement 的 HTML 代码

                  相关文章

                • <legend id='OndE3'><style id='OndE3'><dir id='OndE3'><q id='OndE3'></q></dir></style></legend>

                  <tfoot id='OndE3'></tfoot>

                  <small id='OndE3'></small><noframes id='OndE3'>

                    • <bdo id='OndE3'></bdo><ul id='OndE3'></ul>
                    <i id='OndE3'><tr id='OndE3'><dt id='OndE3'><q id='OndE3'><span id='OndE3'><b id='OndE3'><form id='OndE3'><ins id='OndE3'></ins><ul id='OndE3'></ul><sub id='OndE3'></sub></form><legend id='OndE3'></legend><bdo id='OndE3'><pre id='OndE3'><center id='OndE3'></center></pre></bdo></b><th id='OndE3'></th></span></q></dt></tr></i><div id='OndE3'><tfoot id='OndE3'></tfoot><dl id='OndE3'><fieldset id='OndE3'></fieldset></dl></div>