Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Alex P99 Points
I´m sorry but I´m still getting Error: The ChromeDriver could not be found on the current PATH. Pls help.
I´m getting Error: The ChromeDriver could not be found on the current PATH. Please download the latest version... ...http://chromedriver.storage.googleapis.com/index.html and ensure...
I downloaded lates version (right now is v2.33) and still stuck in it.
This is the [...mypath] where installed "chrome.js": (C:\Users\MyName\selenium-basics\node_modules\selenium-webdriver\chrome.js
And getting the message: at Error (native) at ServiceBuilder [...mypath: (numbers) ] at getDefaultService [...mypath: (numbers)] at Function.createSession [...mypath: (numbers)] at createDriver [...mypath: (numbers)] at Builder.buil [...mypath: (numbers)]
at repl:1:60 at sigintHandlersWrap (vm.js.22:35) at sigintHandlersWrap (vm.js:73:12) at ContextifyScript.Script.runInThisContext
Please help! Thanks in advance .
Daniel Riches19,847 Points
I think that I might have a solution. I previously added a comment with some links to information. I will soon try and find out if I needed to actually change the Environment Variable of Path or not, but that was part of my solution.
While in my directory for selenium-basics which I created for this course and have all of the program files, in the console I did the command 'where chromedriver' and I got the file path to the folder where the .exe file exists. I then added this file path to my PATH Environment Variable. It still did not work so I'm not sure whether I needed to do that. I'm pretty sure that changing the PATH for me was unnecessary. I think maybe you just need to add require('chromedriver');
What ultimately fixed the issue was this line at the top of my file: require('chromedriver');
I would try adding that first if you do not have it
I'll watch the tutorial again to see if I missed it, but found this info here: https://www.npmjs.com/package/chromedriver
So, ultimately I created this file: first_test.js
which contains this code:
require('chromedriver'); const selenium = require('selenium-webdriver'); const driver = new selenium.Builder().forBrowser("chrome").build(); const url = "http://google.com";
then node first_test.js
It worked in the console too. I hope this helps. Sorry for the rambling, I'm testing it as I write. Good luck.
Bryce GerardCourses Plus Student 375 Points
It's still not working for me. How come an official answer hasn't been posted yet? This question has been up for months.
Aleksey Papushin5,554 Points
If you experiencing this issue on Windows, consider following solution which helped me.
- Install chromedriver locally - from command line opened in your project folder and without '-g' flag:
npm install chromedriver
- Then use firstly
require('chromedriver');and then use commands that provided in lesson. Good luck!
Uri Ben Jacob2,223 Points
I'm getting the same error but i got the latest version(v2.35) and it seems the error comes from a different problem connecting to something else .
I'm bumping this question! I was even directed to enter:
const selenium = require("selenium-webdriver@3");
However, everything I enter comes up with an error, even: