最新版Chrome v52.0.2743.116似乎影响了我们使用Selenium和Chrome的测试。如果Chrome有更新,我们之前已通过Selenium NuGet软件包更新了chromedriver版本。最近的驱动程序提到与v52兼容。
构建ChromeDriver(OpenQA.Selenium,Chrome)的调用失败,如图所示
OpenQA.Selenium.WebDriverException: The HTTP request to the remote WebDriver server for URL http://localhost:9220/session timed out after 60 seconds. ---> System.Net.WebException: The request was aborted: The operation has timed out.
堆栈跟踪是:
at System.Net.HttpWebRequest.GetResponse()
at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
--- End of inner exception stack trace ---
at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
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.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(String chromeDriverDirectory, ChromeOptions options)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(String chromeDriverDirectory)
at InternalPortal.IntegrationTests.Helpers.WebBrowser.get_Current() in C:\GoAgent\pipelines\WHSLE_IntFacing_CustPortal_Commit\Source\InternalPortal.IntegrationTests\Helpers\WebBrowser.cs:line 59
第59行的代码如下:
ScenarioContext.Current["webDriverChrome"] = new ChromeDriver(path);
这会将路径传递到chromedriver.exe文件所在的位置。
这些测试之前一直有效,直到Chrome版本从v51更新到v52。它正在使用ChromeDriver版本2.19(Selenium NuGet 2.19.0.0),所以我们升级到2.23(Selenium NuGet 2.23.0.1),它显示与v52一起工作但我们得到了例外。
测试正在通过Thoughtworks GO代理运行,如果有帮助,则由管道作业触发。
由于 杰森