Result StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
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(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeOptions options)
at WhitelabelUITest_New.Initializers.Initialize() in X:\QA\WhitelabelUI-Automation\WhitelabelUITest-New\Initializers.cs:line 87
at WhitelabelUITest_New.Initializers..ctor() in X:\QA\WhitelabelUI-Automation\WhitelabelUITest-New\Initializers.cs:line 41
at WhitelabelUITest_New.Webpage..ctor()
at WhitelabelUITest_New.ImpressionTests..ctor()
Result Message: Unable to create instance of class WhitelabelUITest_New.ImpressionTests. Error: System.InvalidOperationException: session not created: Chrome version must be between 70 and 73
(Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.16299 x86_64) (SessionNotCreated).
我安装了最新版本的Chrome驱动程序,但是每次运行测试用例时,它都不会启动Chrome驱动程序,并且测试失败。
答案 0 :(得分:6)
此错误消息...
Result Message: Unable to create instance of class WhitelabelUITest_New.ImpressionTests. Error: System.InvalidOperationException: session not created: Chrome version must be between 70 and 73
(Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.16299 x86_64) (SessionNotCreated).
...表示 ChromeDriver 期望 Chrome浏览器版本介于70到73 之间。
您的主要问题是所使用的二进制版本之间的不兼容性:
支持 Chrome v73
很明显,您的 Chrome浏览器版本不是 73.0
版本@Test
。driver.quit()
方法内调用tearDown(){}
,以优雅地关闭和销毁 WebDriver 和 Web Client 实例。答案 1 :(得分:2)
卸载Chrome
从脱机安装程序here重新安装。