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

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

    <tfoot id='niAKN'></tfoot>

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

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

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

        时间:2023-09-28
          • <tfoot id='e72V9'></tfoot>
              <i id='e72V9'><tr id='e72V9'><dt id='e72V9'><q id='e72V9'><span id='e72V9'><b id='e72V9'><form id='e72V9'><ins id='e72V9'></ins><ul id='e72V9'></ul><sub id='e72V9'></sub></form><legend id='e72V9'></legend><bdo id='e72V9'><pre id='e72V9'><center id='e72V9'></center></pre></bdo></b><th id='e72V9'></th></span></q></dt></tr></i><div id='e72V9'><tfoot id='e72V9'></tfoot><dl id='e72V9'><fieldset id='e72V9'></fieldset></dl></div>
                <bdo id='e72V9'></bdo><ul id='e72V9'></ul>

                    <tbody id='e72V9'></tbody>
                  <legend id='e72V9'><style id='e72V9'><dir id='e72V9'><q id='e72V9'></q></dir></style></legend>

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

                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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:自动化测试错误:org.openqa.selenium.WebDriverException:断 下一篇:如何修复 [1573451709.039][警告]:连接到 Chrome 时超时

                  相关文章

                  最新文章

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

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

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

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