未创建会话异常:将Selenium Webdriver与Chrome搭配使用时,Chrome版本必须为> = x.y.z [英] Session not created exception: Chrome version must be >= x.y.z when using Selenium Webdriver with Chrome

查看:131
本文介绍了未创建会话异常:将Selenium Webdriver与Chrome搭配使用时,Chrome版本必须为> = x.y.z的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一些棘手的问题是我正在使用c9.io(在云中开发),所以我使用gem webdrivers能够在 Watir ,而不是为我的设备上安装的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.

我的代码一直有效,直到我今天登录并出现错误

My code was working until I logged in today and got the error

未创建会话异常:Chrome版本必须为> = 64.0.3282.0(驱动程序信息:chromedriver = 2.37.543610(afd36256570660b5a2f0e4dbd1b040f3dcfe9cb5),平台= Linux 4.9.80-c9 x86_64)

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)

gemfile的相关部分(其他所有库存)

Relevant parts of gemfile (everything else is stock)

gem 'webdrivers'

gem 'watir'

我正在尝试编译的代码

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

我并没有坚持使用Chrome的想法,但这正是对我有用的.宝石"webdrivers"还允许我使用firefox,但是我收到了权限被拒绝"的错误.

I'm not stuck on the idea of using Chrome, but it's what was working for me. The gem 'webdrivers' also allows me to use firefox, but I get the error 'permission denied' with that.

推荐答案

此错误消息…

未创建会话异常:Chrome版本必须为> = 64.0.3282.0(驱动程序信息:chromedriver = 2.37.543610(afd36256570660b5a2f0e4dbd1b040f3dcfe9cb5),平台= Linux 4.9.80-c9 x86_64)

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

您的主要问题是所使用的二进制文件之间的版本兼容性:

Your main issue is the version compatibility between the binaries you are using as follows:

  • 您正在使用的 chromedriver = 2.37 仍然不是 GA ,因此我们不确定相关性,但是从错误消息中可以明显看出,它不支持 Chrome v64.x
  • 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.36 ,其中发行说明提到支持Chrome v63-65
    • 或升级到 chrome = 65.x
    • To be safer you can:
      • Either downgrade to chromedriver=2.36 where the Release Notes mentions Supports Chrome v63-65
      • Or upgrade to chrome=65.x

      这篇关于未创建会话异常:将Selenium Webdriver与Chrome搭配使用时,Chrome版本必须为> = x.y.z的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆