Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将chrome升级到63版后出现Selenium ChromeDriver异常_C#_Selenium - Fatal编程技术网

C# 将chrome升级到63版后出现Selenium ChromeDriver异常

C# 将chrome升级到63版后出现Selenium ChromeDriver异常,c#,selenium,C#,Selenium,我们有一个自动化的Selenium解决方案,用于管理面板上的一些日常工作。它一直工作到昨天突然坏了。导航很好: driver.Navigate().GoToUrl(url); // this works just fine 但是,这一行中断: var inputs = driver.FindElements(By.CssSelector("input")); 例外信息是: Unexpected error. System.Net.WebException: Unable to connect

我们有一个自动化的Selenium解决方案,用于管理面板上的一些日常工作。它一直工作到昨天突然坏了。导航很好:

driver.Navigate().GoToUrl(url); // this works just fine
但是,这一行中断:

var inputs = driver.FindElements(By.CssSelector("input"));
例外信息是:

Unexpected error. System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:2110
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
   at System.Net.HttpWebRequest.GetRequestStream()
   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value)
   at OpenQA.Selenium.Remote.RemoteWebDriver.FindElementByCssSelector(String cssSelector)
   at OpenQA.Selenium.By.<>c__DisplayClass1e.<CssSelector>b__1c(ISearchContext context)
   at OpenQA.Selenium.By.FindElement(ISearchContext context)
   at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(By by)
意外错误。System.Net.WebException:无法连接到远程服务器-->System.Net.Sockets.SocketException:无法建立连接,因为目标计算机主动拒绝了它127.0.0.1:2110
位于System.Net.Sockets.Socket.DoConnect(端点端点快照,SocketAddress SocketAddress)
在System.Net.ServicePoint.ConnectSocketInternal(布尔连接失败、套接字s4、套接字s6、套接字和套接字、IPAddress和address、ConnectSocketState状态、IAsyncResult asyncResult、异常和异常)
---内部异常堆栈跟踪的结束---
位于System.Net.HttpWebRequest.GetRequestStream(TransportContext和context)
在System.Net.HttpWebRequest.GetRequestStream()中
在OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(commandcommandtoexecute)
在OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(commandcommandtoexecute)
在OpenQA.Selenium.Remote.RemoteWebDriver.Execute(stringdrivercommandtoexecute,Dictionary`2参数)
在OpenQA.Selenium.Remote.RemoteWebDriver.UnpackantRownerError(响应错误响应)中
在OpenQA.Selenium.Remote.RemoteWebDriver.Execute(stringdrivercommandtoexecute,Dictionary`2参数)
在OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(字符串机制,字符串值)
在OpenQA.Selenium.Remote.RemoteWebDriver.FindElementByCssSelector(字符串cssSelector)中
在OpenQA.Selenium.By.c__DisplayClass1e.b_1c(ISearchContext上下文)中
在OpenQA.Selenium.By.FindElement(ISearchContext)上
位于OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(By)

我不知道这个问题的原因是什么。由于Chrome63版正在强制HST,我想chromedriver.exe可能有问题,因为Chrome63有巨大的变化。请帮助。

西服的评论似乎是正确的(谢谢)。我安装了最新的WebDriver nuget软件包,但没有安装最新的chromedriver.exe。版本2.34已经修复了它


你的chromedriver.exe的版本是什么?我怎么知道?在cmd中运行它。我想你应该把它定在2点34分