问题描述
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:QAWhitelabelUI-AutomationWhitelabelUITest-NewInitializers.cs:line 87
at WhitelabelUITest_New.Initializers..ctor() in X:QAWhitelabelUI-AutomationWhitelabelUITest-NewInitializers.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驱动,测试失败.
I installed the latest version of Chrome driver, but every time I run a test case, it does not initiate the Chrome driver and the test fails.
推荐答案
这个错误信息...
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 之间.
...implies that the ChromeDriver expects the Chrome Browser version to be between 70 and 73.
您的主要问题是您使用的二进制文件版本之间的不兼容性,如下所示:
Your main issue is the incompatibility between the version of the binaries you are using as follows:
- 您正在使用 chromedriver=73.0.3683.68
- chromedriver=73.0.3683.68 的发行说明 明确提及以下内容:
支持 Chrome v73
- 我们不知道您的 Chrome 浏览器版本.
- 将 ChromeDriver 保存到 ChromeDriver v73.0.3683.68 级别.
- 升级/降级 Chrome 版本到 Chrome v73 级别.(根据 ChromeDriver v73.0.3683.68 发行说明)李>
- 清理你的项目工作区通过你的IDE和重建你的项目只需要依赖.
- 如果您的基本 Web 客户端 版本太旧,请卸载它并安装最新的 GA 和发布版本的 Web 客户端.
- 执行你的
@Test
. - 总是在
tearDown(){}
方法中调用driver.quit()
来关闭 &优雅地销毁 WebDriver 和 Web Client 实例. - Keep ChromeDriver to ChromeDriver v73.0.3683.68 level.
- Upgrade/Downgrade Chrome version to Chrome v73 level. (as per ChromeDriver v73.0.3683.68 release notes)
- Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
- If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
- Execute your
@Test
. - Always invoke
driver.quit()
withintearDown(){}
method to close & destroy the WebDriver and Web Client instances gracefully. - 如何在 Chrome 浏览器通过 Python selenium 自动更新时使用特定版本的 ChromeDriver
很明显,您的 Chrome 浏览器 版本不是 73.0
It is pretty evident your Chrome Browser version is not of version 73.0
您可以在以下位置找到相关的详细讨论:
You can find a relevant detailed discussion in:
这篇关于错误:System.InvalidOperationException:未创建会话:Chrome 版本必须在 70 到 73 之间,使用 ChromeDriver 和 Chrome 通过 Selenium的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!