简体   繁体   English

会话未创建例外:使用Selenium Webdriver和Chrome时,Chrome版本必须> = xyz

[英]Session not created exception: Chrome version must be >= x.y.z when using Selenium Webdriver with Chrome

A few notes that make this tricky are that I'm using c9.io (developing in the cloud) so I use the gem webdrivers to be able to run Chrome with Watir , instead of creating an executable path to the Chrome installed on my device. 让我觉得这很棘手的一些注意事项是我正在使用c9.io (在云端开发),所以我使用gem webdrivers来运行带有Watir的 Chrome ,而不是创建一个安装在我的设备上的Chrome的可执行路径。

My code was working until I logged in today and got the error 我的代码一直工作,直到我今天登录并收到错误

session not created exception: Chrome version must be >= 64.0.3282.0 (Driver info: chromedriver=2.37.543610 (afd36256570660b5a2f0e4dbd1b040f3dcfe9cb5),platform=Linux 4.9.80-c9 x86_64) 会话未创建异常:Chrome版本必须> = 64.0.3282.0(驱动程序信息:chromedriver = 2.37.543610(afd36256570660b5a2f0e4dbd1b040f3dcfe9cb5),platform = Linux 4.9.80-c9 x86_64)

Relevant parts of gemfile (everything else is stock) gemfile的相关部分(其他一切都是库存)

gem 'webdrivers'

gem 'watir'

Code I'm trying to compile 代码我正在尝试编译

def mastersave
    require 'watir'
    @browser = Watir::Browser.new :chrome, headless: true
end

I'm not stuck on the idea of using Chrome, but it's what was working for me. 我并不是坚持使用Chrome的想法,但这对我有用。 The gem 'webdrivers' also allows me to use firefox, but I get the error 'permission denied' with that. gem'webdrivers'也允许我使用firefox,但是我得到错误''permission denied'。

For those that have just had this problem going from Chrome 73 to 74 it might be because you are using chromedriver-helper . 对于刚从Chrome 73到74的问题,可能是因为你正在使用chromedriver-helper Apparently the chromedriver-helper gem was deprecated. 显然, chromedriver-helper gem已被弃用。 I switched to using the webdrivers gem and it fixed the issue. 我转而使用webdrivers gem并解决了这个问题。

In Gemfile replace: gem 'chromedriver-helper' 在Gemfile中替换: gem 'chromedriver-helper'

With: gem 'webdrivers', '~> 3.0' 使用: gem 'webdrivers', '~> 3.0'

bundle install

This error message… 此错误消息...

session not created exception: Chrome version must be >= 64.0.3282.0 (Driver info: chromedriver=2.37.543610 (afd36256570660b5a2f0e4dbd1b040f3dcfe9cb5),platform=Linux 4.9.80-c9 x86_64) 会话未创建异常:Chrome版本必须> = 64.0.3282.0(驱动程序信息:chromedriver = 2.37.543610(afd36256570660b5a2f0e4dbd1b040f3dcfe9cb5),platform = Linux 4.9.80-c9 x86_64)

…implies that Chrome version must be >= 64.0 ...暗示Chrome版本必须> = 64.0

Your main issue is the version compatibility between the binaries you are using as follows: 您的主要问题是您使用的二进制文件之间的版本兼容性如下:

  • You are using chromedriver=2.37 which is still not GA hence we are not sure about the dependencies but from the error message its clear it won't be supporting Chrome v64.x 你正在使用chromedriver = 2.37 ,它仍然不是GA,因此我们不确定依赖关系但是从错误消息中可以看出它不支持Chrome v64.x

Solution

  • To be safer you can: 为了更安全,您可以:
    • Either downgrade to chromedriver=2.36 where the Release Notes mentions Supports Chrome v63-65 要么降级到chromedriver = 2.36发行说明中提到支持Chrome v63-65
    • Or upgrade to chrome=65.x 或者升级到chrome = 65.x
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only. 通过IDE 清理 项目工作区 ,并仅使用所需的依赖项重建项目。
  • Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite . 使用CCleaner工具在执行测试套件之前和之后擦除所有操作系统。
  • If your base Chrome version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Chrome. 如果您的基本Chrome版本太旧,请通过Revo Uninstaller将其卸载并安装最新的GA和已发布的Chrome版本。
  • Execute your @Test . 执行你的@Test

The following error Chrome version must be >= 64.0.3282.0 , says it is NOT compatible with current chromedriver version 2.37 以下错误Chrome version must be >= 64.0.3282.0 ,表示它与当前的chromedriver版本2.37 不兼容

Updating chrome to latest version should solve the issue. 将chrome更新到最新版本应该可以解决问题。

please refer to https://sites.google.com/a/chromium.org/chromedriver/downloads . 请参阅https://sites.google.com/a/chromium.org/chromedriver/downloads

Latest Release: ChromeDriver 2.36 最新发布:ChromeDriver 2.36

Supports Chrome v63-65 支持Chrome v63-65

Updating the Google Chrome version to 74 worked for me. 将Google Chrome版本更新为74对我有用。

Steps: 1. Go to Help -> About Google Chrome -> Chrome will automatically look for updates(update Chrome to the latest version) 步骤: 1。转到帮助 - >关于Google Chrome - > Chrome会自动查找更新(将Chrome更新到最新版本)

在此输入图像描述

Also, note that you should be having an updated chrome driver. 另请注意,您应该拥有更新的Chrome驱动程序。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Selenium Webdriver Zoom with Ruby for Chrome - Selenium webdriver zoom with Ruby for Chrome 使Selenium WebDriver在RSpec / Rails中使用Chrome - Getting Selenium WebDriver to use Chrome in RSpec/Rails 如何访问 cookies(Capybara/Selenium Chrome Webdriver) - How to access cookies (Capybara/Selenium Chrome Webdriver) 尝试在Chrome v54.0.2810.98和Selenium Webdriver 2.53.0上启动Selenium测试时打开空白页 - Blank page opened when trying to start a Selenium test on Chrome v54.0.2810.98 and Selenium webdriver 2.53.0 使用 Webdriver & Ruby 的 UI 测试自动化; 无法初始化 chrome 浏览器 session - UI test automation using Webdriver & Ruby; was not able to initialise the chrome browser session 如何修复 WSL2 中的“Selenium::WebDriver::Error::WebDriverError: chrome notreachable” - How to fix "Selenium::WebDriver::Error::WebDriverError: chrome not reachable" in WSL2 如何在Amazon Linux上使用带有chrome驱动程序的selenium。 错误:Selenium :: WebDriver :: Error :: UnknownError:未知错误:找不到Chrome二进制文件 - How to use selenium with chrome driver on Amazon Linux. error: Selenium::WebDriver::Error::UnknownError: unknown error: cannot find Chrome binary 使用水豚和硒的Chrome无头下载pdf - Chrome headless download pdf using capybara and selenium Selenium::WebDriver::Error::UnknownError: 未知错误: Chrome 启动失败: 异常退出 - Selenium::WebDriver::Error::UnknownError: unknown error: Chrome failed to start: exited abnormally Z = X + Y时如何防止堆叠顺序? X总是在最前面 - how to prevent stacked ordering when I do Z=X+Y? X is always on top
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM