john-doherty / selenium-cucumber-js

Browser automation framework written in pure JavaScript using official selenium-webdriver and cucumber-js
ISC License
120 stars 89 forks source link

The version of chromedriver installed by default together with selenium-cucumber-js is too old and unsupported by modern browsers #101

Closed ka84 closed 4 years ago

ka84 commented 4 years ago

Just following your getting start guides and installed everything from a scratch. The version of chromedriver installed is 76.0.1 however my chrome browser is of higher version (81) and the driver is incompatible with it anymore. Whenever I tried to run the example tests shipped together with the npm they gave me this:

SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 76
       (Driver info: chromedriver=76.0.3809.126 (d80a294506b4c9d18015e755cee48f953ddc3f2f-refs/branch-heads/3809@{#1024}),platform=Mac OS X 10.11.6 x86_64)
         at Object.checkLegacyResponse (/private/tmp/tst/node_modules/selenium-webdriver/lib/error.js:529:15)
         at parseHttpResponse (/private/tmp/tst/node_modules/selenium-webdriver/lib/http.js:509:13)
         at /private/tmp/tst/node_modules/selenium-webdriver/lib/http.js:441:30
         at processTicksAndRejections (internal/process/task_queues.js:97:5)
     From: Task: WebDriver.createSession()
         at Function.createSession (/private/tmp/tst/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
         at Function.createSession (/private/tmp/tst/node_modules/selenium-webdriver/chrome.js:761:15)
         at createDriver (/private/tmp/tst/node_modules/selenium-webdriver/index.js:170:33)
         at Builder.build (/private/tmp/tst/node_modules/selenium-webdriver/index.js:642:16)
         at new module.exports (/private/tmp/tst/node_modules/selenium-cucumber-js/runtime/chromeDriver.js:20:8)
         at getDriverInstance (/private/tmp/tst/node_modules/selenium-cucumber-js/runtime/world.js:54:22)
         at /private/tmp/tst/node_modules/selenium-cucumber-js/runtime/world.js:207:29

I found no way to download Chrome of version 76 to my mac - looks like Google has already removed all the links for downloading it from public (what a shame). Whenever I ran the npm outdated in the directory node_modules/selenium-cucumber-js it gave me this:

$ npm outdated
Package                 Current  Wanted         Latest  Location
chai                    MISSING   3.5.0          4.2.0  selenium-cucumber-js
chalk                   MISSING   1.1.3          4.0.0  selenium-cucumber-js
commander               MISSING   2.9.0          5.0.0  selenium-cucumber-js
cucumber                MISSING   1.3.3          6.0.5  selenium-cucumber-js
cucumber-html-reporter  MISSING   4.0.4          5.2.0  selenium-cucumber-js
cucumber-junit          MISSING   1.6.0          1.7.1  selenium-cucumber-js
electron                MISSING   1.8.8          8.2.1  selenium-cucumber-js
electron-chromedriver   MISSING   1.8.0          8.0.0  selenium-cucumber-js
electron-packager       MISSING   9.1.0         14.2.1  selenium-cucumber-js
eyes.selenium           MISSING  0.0.72         3.8.11  selenium-cucumber-js
fs-plus                 MISSING   2.9.1          3.1.1  selenium-cucumber-js
geckodriver             MISSING  1.19.1         1.19.1  selenium-cucumber-js
merge                   MISSING   1.2.1          1.2.1  selenium-cucumber-js
phantomjs-prebuilt      MISSING  2.1.12         2.1.16  selenium-cucumber-js
require-dir             MISSING   0.3.2          1.2.0  selenium-cucumber-js
selenium-webdriver      MISSING   3.5.0  4.0.0-alpha.7  selenium-cucumber-js
chromedriver             76.0.1  76.0.1         80.0.2  selenium-cucumber-js

So I decided to ugprade the driver. I modified node_modules/selenium-cucumber-js/package.json:

"chromedriver": "^80.0.2",

... and ran npm update chromedriver. After upgrade I managed to run your example project to see how it works.

tjl694 commented 4 years ago

I've got a PR in which includes a change to the value in package.json to the chromedriver's git page, so it always gets the latest Chromedriver.

Until this is approved, you can do this change locally: "chromedriver": "git+https://github.com/giggio/node-chromedriver#master",

john-doherty commented 4 years ago

Fixed