[🐛 Bug]: creating service with explicit path points to wrong driver
See original GitHub issueWhat 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:
- Created a year ago
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@andykais yes exactly, the driver is a shim created by the browser vendor that translates Selenium commands to browser actions.
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.