question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[🐛 Bug]: creating service with explicit path points to wrong driver

See original GitHub issue

What happened?

I downloaded a chrome driver here http://chromedriver.storage.googleapis.com/index.html?path=106.0.5249.21 and wanted to spin up a selenium instance pointed at it. Instead, what happened was the selenium-webdriver nodejs module attempted to point to the chrome executable I have installed on my system, which was too old for what it was expecting, and the program crashed

How can we reproduce the issue?

import chrome from 'selenium-webdriver/chrome'

async function run() {
  const service = new chrome.ServiceBuilder('./chromedriver_linux64/chromedriver')
    .loggingTo('chrome.log')
    .build()

  const options = new chrome.Options()
  const driver = chrome.Driver.createSession(options, service)
  await driver.get('http://www.google.com/ncr');
}

run()

Relevant log output

/home/andrew/Code/development/selenium-scraper/node_modules/.pnpm/selenium-webdriver@4.4.0/node_modules/selenium-webdriver/lib/error.js:522
    let err = new ctor(data.message)
              ^
SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 106
Current browser version is 104.0.5112.79 with binary path /opt/google/chrome/google-chrome
    at Object.throwDecodedError (/home/andrew/Code/development/selenium-scraper/node_modules/.pnpm/selenium-webdriver@4.4.0/node_modules/selenium-webdriver/lib/error.js:522:15)
    at parseHttpResponse (/home/andrew/Code/development/selenium-scraper/node_modules/.pnpm/selenium-webdriver@4.4.0/node_modules/selenium-webdriver/lib/http.js:589:13)
    at Executor.execute (/home/andrew/Code/development/selenium-scraper/node_modules/.pnpm/selenium-webdriver@4.4.0/node_modules/selenium-webdriver/lib/http.js:514:28)
    at processTicksAndRejections (node:internal/process/task_queues:95:5) {
  remoteStacktrace: '#0 0x5631c82b7343 <unknown>\n' +
    '#1 0x5631c80c154a <unknown>\n' +
    '#2 0x5631c80ead82 <unknown>\n' +
    '#3 0x5631c80e653d <unknown>\n' +
    '#4 0x5631c80e2256 <unknown>\n' +
    '#5 0x5631c8120af6 <unknown>\n' +
    '#6 0x5631c812045f <unknown>\n' +
    '#7 0x5631c8118a73 <unknown>\n' +
    '#8 0x5631c80ed4f3 <unknown>\n' +
    '#9 0x5631c80ee731 <unknown>\n' +
    '#10 0x5631c830562e <unknown>\n' +
    '#11 0x5631c8308ac2 <unknown>\n' +
    '#12 0x5631c82ebf4e <unknown>\n' +
    '#13 0x5631c8309743 <unknown>\n' +
    '#14 0x5631c82e036f <unknown>\n' +
    '#15 0x5631c8329a28 <unknown>\n' +
    '#16 0x5631c8329ba6 <unknown>\n' +
    '#17 0x5631c8343d52 <unknown>\n' +
    '#18 0x7f42de5ed78d <unknown>\n'
}

you can see that instead of the relative path set on the service, it is picking the system version of chrome I have installed (/opt/google/chrome/google-chrome).



### Operating System

Arch Linux

### Selenium version

nodejs v18.8.0,     "selenium-webdriver": "^4.4.0"

### What are the browser(s) and version(s) where you see this issue?

Chrome 106.0.5249.21

### What are the browser driver(s) and version(s) where you see this issue?

Chrome 106.0.5249.21

### Are you using Selenium Grid?

n/a

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
titusfortnercommented, Sep 22, 2022

@andykais yes exactly, the driver is a shim created by the browser vendor that translates Selenium commands to browser actions.

0reactions
github-actions[bot]commented, Oct 23, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

selenium - chromedriver executable needs to be in PATH
By the way, I tried typing "chromedriver" in cmd, however, it wasn't recognized as an internal or external command. error shown below: Traceback ......
Read more >
How to fix common Selenium errors? - Ultimate QA
Selenium webdriver errors that are commonly faced by QA Engineers. This article covers all the common errors including Firefox and Selenium ...
Read more >
How to troubleshoot Windows Installer errors - Microsoft Support
Describes how to troubleshoot problems that occur when you install, uninstall, or upgrade a program on a Windows-based computer by using Windows Installer....
Read more >
How to Handle the UnsatisfiedLinkError Runtime Error in Java
How to Handle the UnsatisfiedLinkError Error · Make sure that the library name and/or path are specified correctly. · Always call System. ·...
Read more >
11 Ways to Fix "The System Cannot Find The Path Specified ...
Once again, review the code you're running and see if there are any errors in the paths you've added. If there is an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found