Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialErick Luna
21,076 PointsI'm getting this message while using the build pattern "The ChromeDriver could not be found on the current PATH"
The full error message is: " The ChromeDriver could not be found on the current PATH. Please download the latest version of t he ChromeDriver from http://chromedriver.storage.googleapis.com/index.html and ensure it can be found o n your PATH."
3 Answers
Sarper Temel
430 PointsI exactly have the same problem and still looking for the solutions.
Avery Miller
2,568 PointsI found that I had to import two additional things to get it to run ( credit to this stack overflow answer).
const webdriver = require('selenium-webdriver');
// add these two imports, and the line after that
const chrome = require('selenium-webdriver/chrome');
const chromedriver = require('chromedriver');
// I needed this the first time around, but then I didn't after, so not sure on this
// chrome.setDefaultService(new chrome.ServiceBuilder(chromedriver.path).build());
// NOW I can do this line!
const driver = new selenium.Builder().forBrowser('chrome').build();
Afterwards, I get a message about "a device attach to the system is not functioning" and something with my USB settings, but I think that's just my system thing, and so far it hasn't actually impacted what I'm doing! 😀 Hope this helps!
I previously tried installing it to the project directly. I also tried using a different shell, just in case. I use Git Bash, but I tried in powershell or in the command prompt, all gave the current PATH error message.
Sarper Temel
430 PointsHey mate, thank you for the help. Actually I found the solution and as I can see we thought about the same thing. So my solution is more simple and only 1 line code you need to write.
So my solution is, I added / require('chromedriver'); / this line before I define the driver and build it which is ( const driver = new selenium.Builder().forBrowser("chrome").build(); )
Hope that helps!
Tzvetan Petrov
1,242 PointsTzvetan Petrov
1,242 PointsSame problem - I have followed the steps 1 by 1 -
C:\Users\Kasapcho\selenium-basics>npm install chromedriver -g C:\Users\Kasapcho\AppData\Roaming\npm\chromedriver -> C:\Users\Kasapcho\AppData\Roaming\npm\node_modules\chromedriver\bin\chromedriver
Current existing ChromeDriver binary is unavailable, proceeding with download and extraction. Downloading from file: https://chromedriver.storage.googleapis.com/83.0.4103.39/chromedriver_win32.zip Saving to file: C:\Users\Kasapcho\AppData\Local\Temp\83.0.4103.39\chromedriver\chromedriver_win32.zip Received 1040K... Received 2080K... Received 3120K... Received 4160K... Received 4649K total. Extracting zip contents to C:\Users\Kasapcho\AppData\Local\Temp\83.0.4103.39\chromedriver. Copying to target path C:\Users\Kasapcho\AppData\Roaming\npm\node_modules\chromedriver\lib\chromedriver Done. ChromeDriver binary available at C:\Users\Kasapcho\AppData\Roaming\npm\node_modules\chromedriver\lib\chromedriver\chromedriver.exe
C:\Users\Kasapcho\selenium-basics>chromedriver --version ChromeDriver 83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103@{#416})
C:\Users\Kasapcho\selenium-basics>
C:\Users\Kasapcho\selenium-basics>
C:\Users\Kasapcho\selenium-basics>node Welcome to Node.js v12.18.0. Type ".help" for more information.
using win10 btw ....