Session not created exception: Chrome version must

2019-02-25 10:52发布

问题:

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

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)

Relevant parts of gemfile (everything else is stock)

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. The gem 'webdrivers' also allows me to use firefox, but I get the error 'permission denied' with that.

回答1:

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)

...implies that Chrome version must be >= 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

Solution

  • 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
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
  • If your base Chrome version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Chrome.
  • Execute your @Test.


回答2:

The following error Chrome version must be >= 64.0.3282.0, says it is NOT compatible with current chromedriver version 2.37

Updating chrome to latest version should solve the issue.

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

Latest Release: ChromeDriver 2.36

Supports Chrome v63-65