Tôi hiện đang chạy thử nghiệm của mình với RemoteWebDriver với Selenium Grid 2 thông qua các bộ TestNG. Điều này làm việc tốt với Firefox và IE. Bây giờ tôi đã thêm Chrome và các thử nghiệm chạy tốt, nhưng tôi luôn nhận được một ngoại lệ khi gọi driver.quit() sau tất cả các thử nghiệm của một bộ (hoạt động tốt cho FF và IE).Cách đóng ChromeDriver khi chạy trên Grid?
Các ngoại lệ trông như thế này:
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)
Tôi đang sử dụng Selenium Version 2.24.1 và chromedriver.exe 21.0.1180.4
EDIT
Mã cho teardown:
@AfterSuite
public void tearDown(){
driver.quit();
}
Hoạt động hoàn hảo cho F F và IE với RemoteDriver và không có. Nhưng không phải cho chrome.
Bạn có thể đăng mã trong thiết lập.Siêu chuẩnChromeSetup.tearDown –
thêm thông tin trên tearDown không có gì lạ mắt – Tarken
cùng một thiết lập & cùng một vấn đề ở đây- Tôi cũng nhận được thông báo os rằng chromedriver.exe không hoạt động nữa, khi tôi xác nhận Google Chrome đã bị giết. –