1. <small id='6FwdC'></small><noframes id='6FwdC'>

      <legend id='6FwdC'><style id='6FwdC'><dir id='6FwdC'><q id='6FwdC'></q></dir></style></legend>

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

    3. 在 Grid 上运行时如何关闭 ChromeDriver?

      How to close a ChromeDriver when running on Grid?(在 Grid 上运行时如何关闭 ChromeDriver?)
      <i id='uHYYA'><tr id='uHYYA'><dt id='uHYYA'><q id='uHYYA'><span id='uHYYA'><b id='uHYYA'><form id='uHYYA'><ins id='uHYYA'></ins><ul id='uHYYA'></ul><sub id='uHYYA'></sub></form><legend id='uHYYA'></legend><bdo id='uHYYA'><pre id='uHYYA'><center id='uHYYA'></center></pre></bdo></b><th id='uHYYA'></th></span></q></dt></tr></i><div id='uHYYA'><tfoot id='uHYYA'></tfoot><dl id='uHYYA'><fieldset id='uHYYA'></fieldset></dl></div>

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

        <bdo id='uHYYA'></bdo><ul id='uHYYA'></ul>
        • <tfoot id='uHYYA'></tfoot>
            <tbody id='uHYYA'></tbody>

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

              1. 本文介绍了在 Grid 上运行时如何关闭 ChromeDriver?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我目前正在通过 TestNG 套件使用带有 Selenium Grid 2 的 RemoteWebDriver 运行我的测试.这适用于 Firefox 和 IE.现在我添加了 Chrome 并且测试运行良好,但是在套件的所有测试之后调用 driver.quit() 时总是得到一个异常(适用于 FF 和 IE).

                I am currently running my tests with RemoteWebDriver with Selenium Grid 2 through TestNG suites. This works fine with Firefox and IE. Now I added Chrome and the tests run fine, but I always get an Exception when calling driver.quit() after all tests of a suite (works fine for FF and IE).

                异常如下所示:

                Error communicating with the remote browser. It may have died.
                sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
                at java.lang.reflect.Constructor.newInstance(Constructor.java:513)    
                at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:188)
                at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
                at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:472)
                at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:476)
                at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:346)
                at setups.StandardChromeSetup.tearDown(StandardChromeSetup.java:42)
                19 lines not shown
                
                Caused by Error communicating with the remote browser. It may have died. 
                org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:467)
                at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:476)
                at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:346)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:601)
                at org.openqa.selenium.support.events.EventFiringWebDriver$2.invoke(EventFiringWebDriver.java:101)
                at $Proxy1.quit(Unknown Source)
                at  org.openqa.selenium.support.events.EventFiringWebDriver.quit(EventFiringWebDriver.java:194)
                at org.openqa.selenium.remote.server.handler.DeleteSession.call(DeleteSession.java:42)
                at org.openqa.selenium.remote.server.handler.DeleteSession.call(DeleteSession.java:1)
                at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
                at java.util.concurrent.FutureTask.run(FutureTask.java:166)
                at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:150)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
                at java.lang.Thread.run(Thread.java:722) 
                

                我正在使用 Selenium 版本 2.24.1 和 chromedriver.exe 21.0.1180.4

                I am using Selenium Version 2.24.1 and chromedriver.exe 21.0.1180.4

                编辑

                拆解代码:

                @AfterSuite
                public void tearDown(){
                  driver.quit();
                }
                

                无论有没有 RemoteDriver,都可以完美地用于 FF 和 IE.但不适用于 chrome.

                Works perfectly for FF and IE with RemoteDriver and without. But not for chrome.

                推荐答案

                遇到了同样的问题.这里是我解决它的方法.这似乎是新版 Chrome 驱动程序的错误.使用以前版本的驱动程序 (20.0.1133.0) 为我解决了这个问题.

                Faced the same problem. Here is how I resolved it. This seems to be a bug with the new version of the Chrome driver. Using the previous version of the driver (20.0.1133.0) solved this issue for me.

                查看驱动程序下载页面.

                这篇关于在 Grid 上运行时如何关闭 ChromeDriver?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Lucene Porter Stemmer not public(Lucene Porter Stemmer 未公开)
                How to index pdf, ppt, xl files in lucene (java based or python or php any of these is fine)?(如何在 lucene 中索引 pdf、ppt、xl 文件(基于 java 或 python 或 php 中的任何一个都可以)?)
                KeywordAnalyzer and LowerCaseFilter/LowerCaseTokenizer(KeywordAnalyzer 和 LowerCaseFilter/LowerCaseTokenizer)
                How to search between dates (Hibernate Search)?(如何在日期之间搜索(休眠搜索)?)
                How to get positions from a document term vector in Lucene?(如何从 Lucene 中的文档术语向量中获取位置?)
                Java Lucene 4.5 how to search by case insensitive(Java Lucene 4.5如何按不区分大小写进行搜索)
                <legend id='RFX7D'><style id='RFX7D'><dir id='RFX7D'><q id='RFX7D'></q></dir></style></legend>

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

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