0
Selenium Testを開始しようとすると、エラーが発生し、次のエラーメッセージが表示されます。起動時にChromeDriverが失敗する
OpenQA.Selenium.WebDriverException was unhandled by user code
HResult=-2146233088
Message=A exception with a null response was thrown sending an HTTP
request to the remote WebDriver server for URL http://localhost:55754
/session. The status of the exception was ReceiveFailure, and the message
was: The underlying connection was closed: An unexpected error occurred
on a receive.
Source=WebDriver
InnerException:
HResult=-2146233079
Message=The underlying connection was closed: An unexpected error occurred on a receive.
Source=System
StackTrace:
at System.Net.HttpWebRequest.GetResponse()
at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
InnerException:
HResult=-2146232800
Message=Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
Source=System
StackTrace:
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
InnerException:
ErrorCode=10054
HResult=-2147467259
Message=An existing connection was forcibly closed by the remote host
NativeErrorCode=10054
Source=System
StackTrace:
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
InnerException:
これは失敗したコードですが、何ヶ月も問題なく動作しています。
ChromeOptions options = new ChromeOptions(); // ChromeDriverドライバ=新しいChromeDriver(@ "C:\ Program Files(x86)\ SeleniumDrivers"、オプション); //// Driver =新しいChromeDriver(オプション);
options.AddArgument( " - disable-extensions"); ドライバ=新しいChromeDriver(オプション);
WebDriver関連のすべてのNugetパッケージをアンインストールしてから、再インストールしました。これは私の問題を解決したようです。 –