C# Can';t升级到3.9版后启动Selenium IE驱动程序

C# Can';t升级到3.9版后启动Selenium IE驱动程序,c#,unit-testing,selenium,webdriver,iedriverserver,C#,Unit Testing,Selenium,Webdriver,Iedriverserver,从更新到IEDriverServer 3.9的64位版本后,在尝试使用IE(版本:11.0.9600.17842,Win8.1)运行任何测试时,我遇到以下异常。有人知道如何解决这个问题吗,或者我应该降级到3.8吗 OpenQA.Selenium.WebDriverException:响应为空的异常 向远程WebDriver服务器发送HTTP请求时引发 网址 异常的状态为 ReceiveFailure,消息为:基础连接为 关闭:接收时发生意外错误。--> System.Net.WebExcepti

从更新到IEDriverServer 3.9的64位版本后,在尝试使用IE(版本:11.0.9600.17842,Win8.1)运行任何测试时,我遇到以下异常。有人知道如何解决这个问题吗,或者我应该降级到3.8吗

OpenQA.Selenium.WebDriverException:响应为空的异常 向远程WebDriver服务器发送HTTP请求时引发 网址

异常的状态为 ReceiveFailure,消息为:基础连接为 关闭:接收时发生意外错误。-->

System.Net.WebException:基础连接已关闭:出现错误 接收时发生意外错误。-->System.IO.IOException :无法从传输连接读取数据:现有 远程主机已强制关闭连接。--> System.Net.Sockets.SocketException:已创建现有连接 远程主机强制关闭拆卸: System.NullReferenceException:对象引用未设置为 对象的实例

堆栈跟踪如下所示:

结果:在 OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo 请求信息)在 OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(命令 命令执行)在 OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(命令 命令执行)在 OpenQA.Selenium.Remote.RemoteWebDriver.Execute(字符串 driverCommandToExecute,Dictionary`2个参数)位于 OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities 所需能力)在 OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor 命令执行器,ICapabilities desiredCapabilities)位于 OpenQA.Selenium.IE.InternetExplorerDriver..ctor(InternetExplorerDriverService 服务,InternetExploreProptions选项)位于 OpenQA.Selenium.IE.InternetExplorerDriver..ctor() --OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo)中System.Net.HttpWebRequest.GetResponse()处的WebException异常 请求信息) --位于的System.Net.Sockets.NetworkStream.Read(字节[]缓冲区,Int32偏移量,Int32大小)处的IOException System.Net.PooledStream.Read(字节[]缓冲区,Int32偏移量,Int32大小) 在System.Net.Connection.SyncRead(HttpWebRequest请求,布尔值 userRetrievedStream,布尔probeRead) --位于的System.Net.Sockets.Socket.Receive处的SocketException(字节[]缓冲区,Int32偏移量,Int32大小,SocketFlags SocketFlags) System.Net.Sockets.NetworkStream.Read(字节[]缓冲区,Int32偏移量, Int32大小)

使用IEDriverServer 3.9.0.0 for Windows 64位版本,我可以通过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.exe的v3.9.0.1版本提到以下免责声明:

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.
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\u x64\u 3.8.0

我不得不否决这个答案。它错误地暗示,在原始帖子中提到的3.9.0版本之后所做的更改可能导致问题所描述的问题。它还声称某个版本何时“正式发布”,但Selenium项目开发团队并未认可或承认该版本是正确的。@JimEvans感谢您的关注。但这两个逐字记录都来自IEDriverServer.exe的变更日志。你能指出我到底错在哪里吗。
IEDriverServer.exe v3.9.0.0的可用性尚未进入页面的选项卡,因为更改日志已移动到该选项卡。我很乐意更正我自己。发布到的版本是3.9.0.0。正如您在变更日志中正确注意到的,版本的编号方案为
major.minor.build.revision
,并且仅在
revision
字段中不同的版本根本不会发布。此外,发布到该站点的版本是“发布版本”的总和,而不管通过seleniumhq下载什么。您的意思是3.9.0.1中的更改可能会影响drop站点的发布,即3.9.0.0。@JimEvans谢谢,这是我的错误假设,因此更新了我的答案。我仍然有一个问题要问你,当CHANGELOG文本通过project downloads页面提到as时,它指向选项卡或你共享的链接,该链接现在返回一个错误,因为
指定的bucket不存在。
你的堆栈跟踪似乎表明Java语言绑定试图在IPv6环回地址(
[::1]
),在IE驱动程序的3.9.0.0版本中根本无法使用。为什么64位IE驱动程序会出现这种情况,而不是32位IE驱动程序完全不清楚。了解32位可执行文件是否会产生相同的结果将非常有用。@JimEvans让我们大吃一惊
IEDriverServer_Win32_3.9.0
在基本测试用例中运行得非常顺利。