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 trial

Quality Assurance

Mohib Arsala
Mohib Arsala
7,123 Points

> const driver = new selenium.Builder().forBrowser("chrome").build(); Error: The ChromeDriver could not be found

const driver = new selenium.Builder().forBrowser("chrome").build(); Error: The ChromeDriver could not be found on the current PATH. Please download the latest version of the ChromeDriver from http://chromedriver.storage.goo gleapis.com/index.html and ensure it can be found on your PATH. at new ServiceBuilder (C:\Users\Admin\selenium-basics\node_modules\selenium-webdriver\chrome.js:215:13) at getDefaultService (C:\Users\Admin\selenium-basics\node_modules\selenium-webdriver\chrome.js:304:22) at Function.createSession (C:\Users\Admin\selenium-basics\node_modules\selenium-webdriver\chrome.js:752:44) at createDriver (C:\Users\Admin\selenium-basics\node_modules\selenium-webdriver\index.js:170:33) at Builder.build (C:\Users\Admin\selenium-basics\node_modules\selenium-webdriver\index.js:642:16) at repl:1:60 at ContextifyScript.Script.runInThisContext (vm.js:50:33) at REPLServer.defaultEval (repl.js:239:29) at bound (domain.js:301:14) at REPLServer.runBound [as eval] (domain.js:314:12)

above code is not working in win pc , pops out error how to fix it?

2 Answers

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Hello Mohib,

I don't know if you're still struggling with this issue but if you're using REPL with your command line to try and use Selenium with Chrome try and use

require("chromedriver"); to access it.

So type the above in before you try to get to the driver again.

Good luck :)

Mohib Arsala
Mohib Arsala
7,123 Points

actually i stuck with webdriver installation in win pc , the following method not recognized by commend prompt , (ls node_modules) ? i am mac guy , i didn't have any problem with mac but with Surface pro i ma stuck with above method ?