簡體   English   中英

升級到3.9版后,無法啟動Selenium IE驅動程序

[英]Can't launch Selenium IE Driver after upgrading to version 3.9

此處更新為64位的IEDriverServer 3.9之后,嘗試使用IE(版本:11.0.9600.17842,Win8.1)運行任何測試時,出現以下異常。 有誰知道如何解決這個問題,還是我應該降級到3.8?

OpenQA.Selenium.WebDriverException:引發了具有null響應的異常,該異常將HTTP請求發送到URL為http:// localhost:53379 / session的遠程WebDriver服務器。

異常的狀態為ReceiveFailure,並且消息為:基礎連接已關閉:接收時發生意外錯誤。 ---->

System.Net.WebException:基礎連接已關閉:接收時發生意外錯誤。 ----> System.IO.IOException:無法從傳輸連接讀取數據:遠程主機強行關閉了現有連接。 ----> System.Net.Sockets.SocketException:遠程主機TearDown強制關閉了現有連接:System.NullReferenceException:對象引用未設置為對象的實例。

堆棧跟蹤如下:

結果StackTrace:位於OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(位於Command)的OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo)位於OpenQA。在OpenQA.Selenium.Remote.Remote.RemoteWebDriver.ctor(ICommandExecutor commandExecutor,在IQCapacity.Capacity.Remote.RemoteWebDriver.Execute(String driverCommandToExecute,Dictionary`2 parameters)在OpenQA。 .IE.InternetExplorerDriver..ctor(InternetExplorerDriverService服務,InternetExplorerOptions選項)在OpenQA.Selenium.IE.InternetExplorerDriver..ctor()-WebException在System.Net.HttpWebRequest.GetResponse()在OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest (HttpRequestInfo requestInfo)-System.Net.Sockets.NetworkStream.Read(IOT [Byte [] buffer,Int32 offset, System.Net.PooledStream.Read(字節[]緩沖區的Int32大小),System.Net.Connection.SyncRead(HttpWebRequest請求,Boolean userRetrievedStream,布爾probeRead)的SocketException-System.Net.Sockets上的SocketException .Socket.Receive(Byte []緩沖區,Int32偏移量,Int32大小,SocketFlags socketFlags),位於System.Net.Sockets.NetworkStream.Read(Byte []緩沖區,Int32偏移量,Int32大小)

使用IEDriverServer 3.9.0.0用於Windows 64位來自http://selenium-release.storage.googleapis.com我能夠重現該問題與IEDriverServer_x64_3.9.0。

錯誤堆棧跟蹤:

Started InternetExplorerDriver server (64-bit)
3.9.0.0
Listening on port 28286
Only local connections are allowed
Exception in thread "main" org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:28286
Build info: version: '3.9.1', revision: '63f7b50', time: '2018-02-07T22:42:28.403Z'
System info: host: 'ATECHM-03', ip: '192.168.1.35', os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.8.0_144'
Driver info: driver.version: InternetExplorerDriver
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:92)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
    at org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java:223)
    at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:215)
    at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:152)
    at demo.A_IE_simple.main(A_IE_simple.java:13)
Caused by: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:28286
    at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:240)
    at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:158)
    at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:256)
    at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:134)
    at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:113)
    at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
    at okhttp3.RealCall.execute(RealCall.java:77)
    at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:104)
    at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:54)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:101)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:138)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
    ... 6 more
Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at okhttp3.internal.platform.Platform.connectSocket(Platform.java:125)
    at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:238)
    ... 29 more

盡管使用IEDriverServer_Win32_3.9.0進行的快速測試不會顯示任何錯誤。 盡管已安裝IEDriverServer_Win32_3.9.0IEDriverServer_x64_3.9.0 ,但從未在seleniumhq.org頁面的“ 下載”選項卡上明確推送 / 發布該文件。

IEDriverServer.exeCHANGELOG明確提到以下免責聲明:

The "major" and "minor" fields are synchronized to releases of the Selenium
project. Changes in the "build" field indicate interim releases made publicly
available via the project downloads page. Changes in "revision" field indicate
private releases checked into the prebuilts directory of the source tree, but
not made generally available on the downloads page.

此外, IEDriverServer.exe v3.9.0.1的 CHANGELOG提到以下免責聲明:

Finally, there is every chance that, despite all efforts to the contrary,
it's possible that there are new regressions introduced by this change.
Multiple test suites have been run using this change, and none have
failed thus far due to the changes herein. Claims that this change is
causing a specific failure should be accompanied by a full test case, or
issues reported against this change will be summarily closed.

簡單的解決方案是:

  • 在32位和64位平台上都使用IEDriverServer_Win32_3.9.0
  • 還原回IEDriverServer_x64_3.8.0

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM