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

  2. <tfoot id='wk8Pu'></tfoot>

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

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

      Selenium Chromedriver 服务器超时,尽管可用

      时间:2023-09-28

            <tbody id='GsMoV'></tbody>
          1. <legend id='GsMoV'><style id='GsMoV'><dir id='GsMoV'><q id='GsMoV'></q></dir></style></legend>

              • <bdo id='GsMoV'></bdo><ul id='GsMoV'></ul>
                <tfoot id='GsMoV'></tfoot>

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

                <i id='GsMoV'><tr id='GsMoV'><dt id='GsMoV'><q id='GsMoV'><span id='GsMoV'><b id='GsMoV'><form id='GsMoV'><ins id='GsMoV'></ins><ul id='GsMoV'></ul><sub id='GsMoV'></sub></form><legend id='GsMoV'></legend><bdo id='GsMoV'><pre id='GsMoV'><center id='GsMoV'></center></pre></bdo></b><th id='GsMoV'></th></span></q></dt></tr></i><div id='GsMoV'><tfoot id='GsMoV'></tfoot><dl id='GsMoV'><fieldset id='GsMoV'></fieldset></dl></div>
                本文介绍了Selenium Chromedriver 服务器超时,尽管可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我有一个 Java Selenium 项目,它不能在我的机器上运行,但可以在具有相同操作系统版本 (OSX 10.13.1)、Chrome 浏览器版本 (63.0.3239.84) 和 chromedriver 版本 (2.34) 的同事机器上运行).我收到消息:

                I have a Java Selenium project that will not run on my machine, but does run on coworkers' machines with the same OS version (OSX 10.13.1), Chrome browser version (63.0.3239.84), and chromedriver version (2.34). I get the message:

                Starting ChromeDriver 2.34.522932 (4140ab217e1ca1bec0c4b4d1b148f3361eb3a03e) on port 18633
                Only local connections are allowed.
                
                org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
                Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T18:33:54.468Z'
                System info: host: 'localhost', ip: 'fe80:0:0:0:1cc9:e0ab:f4e5:dd34%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.1', java.version: '1.8.0_20'
                Driver info: driver.version: ChromeDriver
                ...
                Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:18633/status] to be available after 20005 ms
                    at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:100)
                    at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:187)
                    ... 28 more
                Caused by: java.util.concurrent.TimeoutException
                    at java.util.concurrent.FutureTask.get(FutureTask.java:205)
                    at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:149)
                    at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:75)
                    ... 29 more
                

                但是,当我在浏览器中打开 http://localhost:18633/status 时,我得到了有效的响应:

                however when I open http://localhost:18633/status in my browser I get a valid response:

                {"sessionId":"","status":0,"value":{"build":{"version":"alpha"},"os":{"arch":"x86_64","name":"Mac OS X","version":"10.13.1"}}}
                

                我试过换掉 chromedriver 二进制文件,但我不确定还能做什么.我在 geckodriver 上遇到了类似的问题,但这可能是也可能不是同一个问题.我还尝试在我的系统上创建一个新用户并从该帐户运行它,以考虑用户设置 - 不走运.

                I've tried swapping out chromedriver binaries, but I'm not really sure what else to do. I get similar issues with geckodriver, but that may or may not be the same issue. I have also tried creating a new user on my system and running it from that account, to account for user settings - No luck.

                我在这里缺少什么?哪些信息有助于调试此问题?

                What am I missing here? What info would be helpful to debug this problem?

                推荐答案

                错误说明了一切:

                org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
                

                明确指出WebDriver 实例未启动.因此,Driver info 保留为 blank 为:

                Clearly indicates the WebDriver instance didn't get initiated. Hence Driver info is left blank as :

                Driver info: driver.version: ChromeDriver
                

                哪个反过来产生错误:

                org.openqa.selenium.net.UrlChecker$TimeoutException
                

                java.util.concurrent.TimeoutException
                

                <小时>

                如果没有任何代码块的可见性,很难猜测实际原因,但通常我们可以通过下载 repository 并在初始化 WebDriver 实例时传递 ChromeDriver 的绝对路径,如下所示:


                It would be tough to guess the actual reason without any visibility of your code block but in general we can solve this by downloading the ChromeDriver binary from this repository and passing the absolute path of the ChromeDriver while initializing the WebDriver instance as follows :

                System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver");
                driver = new ChromeDriver();
                

                <小时>

                要点:

                • 始终使用 Selenium ClientChromeDriver 二进制文件的最新版本.
                • 始终为浏览器启用自动更新.
                • 始终保持 JDK 版本更新(当前版本为 JDK 8u241)

                • Key Points :

                  • Always use the latest version of the Selenium Client and ChromeDriver binaries.
                  • Always keep the automatic updates for the browser enabled.
                  • Always keep the JDK version updated (the current version being JDK 8u241)
                  • 这篇关于Selenium Chromedriver 服务器超时,尽管可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:WebDriverException: java.net.ConnectException: Failed to conn 下一篇:如何在启动 chrome 浏览器时安装插件?

                相关文章

                最新文章

                <tfoot id='MLGSD'></tfoot>

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

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

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

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