Welcome to the Treehouse Community
Looking to learn something new?
Jonathan GrieveTreehouse 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.
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.
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 :)