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.

Quality Assurance Introduction to Selenium Test Drive Selenium Installation

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,028 Points

How to troubleshoot Selenium Web Driver Installation for Windows

I've been trying to set up a project to test some automation code on my website. I tried to set it up using the notes I made for running Selenium via chrome but I ran into a couple of issues.

I think I've nailed it down to 2 things and I hope this post helps others in the future. Now, as far as I know, Selenium should work with any desktop operating system that uses the major web browsers to go on the web.

Remember this is for Windows 10 OS using JavaScript.

The two things are as follows.

npm install chromedriver --save-dev - Use npm to install chromedriver as a dev dependency

The first thing I did was to try and install Selenium globally, via npm and the process seemed to work. However, when I called the index.js file in git bash there was an error.

Installing as a Dev Dependency seems to have it working in REPL, and in fact, I have now verified that Selenium opens my website in a QA Tab. (Not without further issues though).

require("chromedriver"); - require chromedriver into the project.

The second thing to note is that the build command will not work on Windows without having written a single command to require the chrome driver.

Furthermore, I've found that the browser will close its QA Tab if I use the same code in a JavaScript file but not via REPL.

If this happens you may have to work with Selenium via REPL. I still don't know why the browser would close though. Selenium and I are having a tricky relationship :)