How to setup ChromeDriver 74 with Chrome 74 for Travis?

Any quick fix for this on travis.ci?

Related to https://stackoverflow.com/questions/55201226/session-not-created-this-version-of-chromedriver-only-supports-chrome-version-7

Selenium message:session not created: This version of ChromeDriver only supports Chrome version 74
  (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Mac OS X 10.14.3 x86_64)

Here is the PR I’m trying to fix

Here is my travis config:

language:
  - ruby
rvm:
  - 2.5.3
sudo: true
notifications:
  slack: shakacode:YvfXbuFMcFAHt6ZjABIs0KET
addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - g++-4.9
services:
  - docker

cache:
  bundler: true
  directories:
    - node_modules # NPM packages
  yarn: true

gemfile:
  - Gemfile

env:
  global:
    - RAILS_ENV=test
    - DRIVER=selenium_chrome
    - CHROME_BIN=/usr/bin/google-chrome
    - USE_COVERALLS=TRUE

before_install:
  - sudo apt-get update
  - sudo apt-get install -y xvfb libappindicator1 fonts-liberation
  - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
  - sudo dpkg -i google-chrome*.deb
  - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen scn 1600x1200x16"

install:
  - travis_retry gem install bundler -v '<2' # Ruby 2.2 and Rails 3.2 & 4.2 depend on bundler 1.x.
  - travis_retry nvm install 8.11.3
  - node -v
  - travis_retry npm i -g yarn
  - travis_retry bundle install
  - travis_retry yarn
  - bundle
  - yarn
  - node --version
  - google-chrome --version
  - chromedriver --version
  - yarn install
  - rake db:setup

# Tip: No need to run xvfb if running headless testing.
before_script:
   - export DISPLAY=:99.0
   - sh -e /etc/init.d/xvfb start

script:
  - bundle exec rake db:schema:load
  - bundle exec rake
2 Likes

Temporary fix to revert to a chrome version that was working.

#.travis.yml
before_script:
  - chromedriver-update 73.0.3683.68

Source:

Can anyone from the TravisCI team comment? Would it be possible to make the addons: chrome: stable install both Google Chrome and the matching Chromedriver version? The matching version can be fetched from: https://chromedriver.storage.googleapis.com/index.html (unfortunately there’s no symlink to ‘stable’)

I came up with this solution (using the webdrivers gem, which replaced the chromedriver-helper gem):

before_script:
  - bundle exec rails runner "Webdrivers::Chromedriver.update"

addons:
  chrome: stable
4 Likes

+1 for @januszm’s idea to match chrome and chromedriver versions. The patch from my answer doesn’t work anymore :frowning: my build just broke.

This is still an issue as far as I can tell. Has anyone found a suitable workaround?

For what it’s worth, I fixed this in fantoccini with: https://github.com/jonhoo/fantoccini/commit/ff99c0dc41666cc9124771a553787514fa006021

Hi,

this is an issue for me too

Also, docs on how to use headless chrome do not mention chromedriver at all: https://docs.travis-ci.com/user/chrome

I could submit a PR, but I’m not an English native speaker and this issue is locking

At the moment I’m using the following solution:

addons:
  chrome: stable

before_script:
  - LATEST_CHROMEDRIVER_VERSION=`curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE"`
  - curl "https://chromedriver.storage.googleapis.com/${LATEST_CHROMEDRIVER_VERSION}/chromedriver_linux64.zip" -O
  - unzip chromedriver_linux64.zip -d ~/bin

which also allows me to use

  config.before(:each, type: :system, js: true) do
    driven_by :selenium, using: :headless_chrome
  end

without specifying a custom chrome driver for Selenium, as mentioned at https://docs.travis-ci.com/user/chrome#capybara

Ref: https://github.com/diowa/ruby2-rails5-bootstrap-heroku/commit/6ba95f33f922895090d3fabc140816db67b09672

Hi, I have followed your approach to get dynamic chrome version,

before_install:
- while sleep 9m; do echo "=====[ Build in Progress ]====="; done &
- pip3 install robotframework
- pip3 install -U https://github.com/robotframework/Selenium2Library/archive/v3.0.0.tar.gz
- LATEST_CHROMEDRIVER_VERSION=`curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE"`
- curl "https://chromedriver.storage.googleapis.com/${LATEST_CHROMEDRIVER_VERSION}/chromedriver_linux64.zip" -O
#- wget https://chromedriver.storage.googleapis.com/76.0.3809.126/chromedriver_linux64.zip
- mkdir geckodriver chromedriver
- unzip chromedriver_linux64.zip -d chromedriver/
- export PATH=$PATH:$PWD/chromedriver

but i am still getting error on travis build

SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 77

Can you please help me on this

addons: chrome: doesn’t install chromedriver. You need to check which part of your build logic installs it and tweak it to install the right version.

I’ve built on the solution of @tagliala, by making the script use the version of the Chrome installation, to download the latest associated Chromedriver. Following the steps from: https://chromedriver.chromium.org/downloads/version-selection

before_script:
  - CHROME_MAIN_VERSION=`google-chrome-stable --version | sed -E 's/(^Google Chrome |\.[0-9]+ )//g'`
  - CHROMEDRIVER_VERSION=`curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_MAIN_VERSION"`
  - curl "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip" -O
  - unzip chromedriver_linux64.zip -d ~/bin

This might also fix your issue @Anandh1924?

1 Like