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

      <legend id='m7rWv'><style id='m7rWv'><dir id='m7rWv'><q id='m7rWv'></q></dir></style></legend>
      <i id='m7rWv'><tr id='m7rWv'><dt id='m7rWv'><q id='m7rWv'><span id='m7rWv'><b id='m7rWv'><form id='m7rWv'><ins id='m7rWv'></ins><ul id='m7rWv'></ul><sub id='m7rWv'></sub></form><legend id='m7rWv'></legend><bdo id='m7rWv'><pre id='m7rWv'><center id='m7rWv'></center></pre></bdo></b><th id='m7rWv'></th></span></q></dt></tr></i><div id='m7rWv'><tfoot id='m7rWv'></tfoot><dl id='m7rWv'><fieldset id='m7rWv'></fieldset></dl></div>
      • <bdo id='m7rWv'></bdo><ul id='m7rWv'></ul>
      <tfoot id='m7rWv'></tfoot>
    1. WebDriverException:未知错误:Runtime.executionContextCreat

      时间:2023-09-28
      • <bdo id='5zbmz'></bdo><ul id='5zbmz'></ul>

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

          1. <legend id='5zbmz'><style id='5zbmz'><dir id='5zbmz'><q id='5zbmz'></q></dir></style></legend>

            <small id='5zbmz'></small><noframes id='5zbmz'>

                <tbody id='5zbmz'></tbody>
                本文介绍了WebDriverException:未知错误:Runtime.executionContextCreated 具有无效的“上下文":初始化 Chrome 浏览器时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我正在尝试开始使用 selenium,并已下载 chrome 驱动程序并放入我的类路径中.我现在只是想获得标题,看看我是否可以让它工作.目前的代码如下所示:

                I'm trying to get started using selenium and have downloaded a chrome driver and put into my classpath. I'm just trying to get the title right now to see if I can get it to work. Code currently looks like this:

                import org.openqa.selenium.WebDriver;
                import org.openqa.selenium.chrome.ChromeDriver;
                
                public class Flows {
                
                    public static void main(String[] args) {
                
                        System.setProperty("webdriver.chrome.driver", "/Users/mn/Desktop/project/turv/src/main/chromedriver");
                        WebDriver driver = new ChromeDriver();
                        String baseUrl = "http://google.dk/";
                        driver.get(baseUrl);
                        System.out.println(driver.getTitle());
                        driver.close();
                    }
                }
                

                我希望我的输出类似于Google",但我得到了这个错误:

                I expected my output to be something along the lines of "Google", but I get this error instead:

                Connected to the target VM, address: '127.0.0.1:55299', transport: 'socket'
                Starting ChromeDriver (v2.8.241036) on port 2571
                [warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
                May 07, 2018 12:12:35 PM org.openqa.selenium.remote.ProtocolHandshake createSession
                INFO: Detected dialect: OSS
                Disconnected from the target VM, address: '127.0.0.1:55299', transport: 'socket'
                Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"11895A1B77AC560388AA2919259E1422","isDefault":true},"id":1,"name":"","origin":"://"}
                  (Session info: chrome=66.0.3359.139)
                  (Driver info: chromedriver=2.8.241036,platform=Mac OS X 10.13.3 x86_64) (WARNING: The server did not provide any stacktrace information)
                Command duration or timeout: 0 milliseconds
                Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z'
                System info: host: 'cetreas-MBP', ip: 'fe80:0:0:0:c9e:2c67:1d27:4e0b%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.3', java.version: '1.8.0_161'
                Driver info: org.openqa.selenium.chrome.ChromeDriver
                Capabilities {acceptSslCerts: true, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {userDataDir: /var/folders/s7/lv2wt4t15cn...}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, javascriptEnabled: true, locationContextEnabled: true, nativeEvents: true, platform: MAC, platformName: MAC, rotatable: false, takesHeapSnapshot: true, takesScreenshot: true, version: 66.0.3359.139, webStorageEnabled: true}
                Session ID: ca1f4ba131e73c3d01058bec2b976d22
                    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
                    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
                    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
                    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
                    at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40)
                    at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:80)
                    at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44)
                    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
                    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
                    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
                    at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:273)
                    at com.cetrea.flows.Flows.main(Flows.java:15)
                

                我真的无法弄清楚错误试图告诉我什么.是因为我在网站完全加载之前要求标题吗?我需要在 getTitle() 之前添加某种 waitforit 命令吗?

                I cant really figure out what the error is trying to tell me. Is it because I'm asking for the title before it has fully loaded the site maybe? Do I need to add some kind of waitforit command before the getTitle() ?

                推荐答案

                这个错误信息...

                org.openqa.selenium.WebDriverException: unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"11895A1B77AC560388AA2919259E1422","isDefault":true},"id":1,"name":"","origin":"://"}
                

                ...暗示 ChromeDriver 无法启动/生成新的 WebBrowserChrome 浏览器 会话.

                ...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.

                您的主要问题是您使用的二进制文件之间的版本兼容性,如下所示:

                Your main issue is the version compatibility between the binaries you are using as follows :

                • 您使用的是chromedriver=2.8,它相当古老.
                • 您正在使用 chrome=66.0
                • ChromeDriver v2.38 的发行说明明确提及以下内容:

                支持 Chrome v65-67

                所以 ChromeDriver 版本 (v2.8) 和 Chrome 浏览器 版本 (v66.0) 之间存在明显的不匹配)

                So there is a clear mismatch between ChromeDriver version (v2.8) and the Chrome Browser version (v66.0)

                • ChromeDriver 升级到当前的 ChromeDriver v2.38 级.
                • Chrome 版本保持在 Chrome v66.x 级别.(根据 ChromeDriver v2.38 发行说明)
                • 清理你的项目工作区通过你的IDE重建你的项目只需要依赖.
                • 使用 CCleaner 工具清除之前和之后的所有操作系统杂务测试套件的执行.
                • 如果您的基础 Web Client 版本太旧,请通过 <卸载它em>Revo Uninstaller 并安装最新的 GA 和发布版本的 Web 客户端.
                • 进行一次系统重启.
                • 执行你的 @Test.
                • 总是在 tearDown(){} 方法中调用 driver.quit() 来关闭 &优雅地销毁 WebDriverWeb Client 实例.
                • Upgrade ChromeDriver to current ChromeDriver v2.38 level.
                • Keep Chrome version at Chrome v66.x levels. (as per ChromeDriver v2.38 release notes)
                • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
                • Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
                • If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
                • Take a System Reboot.
                • Execute your @Test.
                • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.

                这篇关于WebDriverException:未知错误:Runtime.executionContextCreated 具有无效的“上下文":初始化 Chrome 浏览器时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:无法从 scoped_dir6312_32763/internal 加载扩展.管理员使 下一篇:org.openqa.selenium.remote.service.DriverService$Builder.crea

                相关文章

                最新文章

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

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

                  2. <small id='fwbIA'></small><noframes id='fwbIA'>

                  3. <tfoot id='fwbIA'></tfoot>