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.
Erick Luna20,171 Points
I'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."
I exactly have the same problem and still looking for the solutions.
Avery Miller1,213 Points
I 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.
Hey 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!