Imansible avviare Selenium IE Driver dopo l’aggiornamento alla versione 3.9

Dopo l’aggiornamento a IEDriverServer 3.9 per 64 bit da qui , sto ricevendo la seguente eccezione quando provo a eseguire test con IE (versione: 11.0.9600.17842, Win8.1). Qualcuno sa come ovviare a questo, o dovrei semplicemente retrocedere a 3.8?

OpenQA.Selenium.WebDriverException: è stata generata un’eccezione con una risposta nulla che inviava una richiesta HTTP al server WebDriver remoto per l’URL http: // localhost: 53379 / session .

Lo stato dell’eccezione era ReceiveFailure e il messaggio era: La connessione sottostante era chiusa: si è verificato un errore imprevisto su una ricezione. —->

System.Net.WebException: la connessione sottostante è stata chiusa: si è verificato un errore imprevisto su una ricezione. —-> System.IO.IOException: imansible leggere i dati dalla connessione di trasporto: una connessione esistente è stata forzatamente chiusa dall’host remoto. —-> System.Net.Sockets.SocketException: una connessione esistente è stata forzatamente chiusa dall’host remoto TearDown: System.NullReferenceException: riferimento object non impostato su un’istanza di un object.

La traccia dello stack è la seguente:

Risultato StackTrace: su OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest (HttpRequestInfo requestInfo) su OpenQA.Selenium.Remote.HttpCommandExecutor.Execute (Command commandToExecute) su OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute (Command commandToExecute) su OpenQA.Selenium. Remote.RemoteWebDriver.Execute (String driverCommandToExecute, Dictionary`2 parameters) su OpenQA.Selenium.Remote.RemoteWebDriver.StartSession (ICapabilities desiderateCapabilities) su OpenQA.Selenium.Remote.RemoteWebDriver..ctor (comando ICommandExecutorExecutor, ICapabilities desiderateCapabilities) su OpenQA.Selenium .IE.InternetExplorerDriver..ctor (servizio InternetExplorerDriverService, opzioni InternetExplorerOptions) su OpenQA.Selenium.IE.InternetExplorerDriver..ctor () –WebException su System.Net.HttpWebRequest.GetResponse () su OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest (HttpRequestInfo requestInfo) –IOException su System.Net.Sockets.NetworkStream.Read (Byte [] buffer, Int32 offset, Int32 size) su System.Net.PooledStream.Read (Byte [] buffer, Int32 offset, Int32 size) su System.Net.Connection.SyncRead (richiesta HttpWebRequest, Boolean userRetrievedStream, Boolean probeRead) –SocketException su System.Net.Sockets .Socket.Receive (Byte [] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) su System.Net.Sockets.NetworkStream.Read (Byte [] buffer, Int32 offset, Int32 size)

Utilizzo di IEDriverServer 3.9.0.0 per Windows 64-bit da http://selenium-release.storage.googleapis.com Sono in grado di riprodurre il problema con IEDriverServer_x64_3.9.0 .

Errore di traccia dello stack:

 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.(InternetExplorerDriver.java:215) at org.openqa.selenium.ie.InternetExplorerDriver.(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 

Anche se un test rapido con IEDriverServer_Win32_3.9.0 non mostra alcun errore. Sebbene IEDriverServer_Win32_3.9.0 e IEDriverServer_x64_3.9.0 siano installati, ma non sono mai stati esplicitamente spinti / pubblicati per essere disponibili nella scheda Download della pagina seleniumhq.org .

Il CHANGELOG di IEDriverServer.exe menziona chiaramente il seguente disclaimer:

 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. 

Inoltre, il CHANGELOG di IEDriverServer.exe v3.9.0.1 menziona la seguente dichiarazione di non responsabilità:

 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. 

Soluzione

La soluzione semplice potrebbe essere:

  • Utilizzare IEDriverServer_Win32_3.9.0 su entrambe le piattaforms a 32 bit e 64 bit.
  • Ripristina su IEDriverServer_x64_3.8.0