Thursday, June 18, 2015

AngularJS Protractor Error In Tutorial

AngularJS Protractor Error In Tutorial


In the tutorials if you attempt to execute npm run protractor to do end to end testing you may get an error on windows that states that that it cannot find the chromedriver.exe file. 


Two issues are likely to present itself

1.       Chromedriver.exe cannot be found

2.       Selenium server timeout

The issue I ran into that the file was downloaded but the chromedriver.exe was missing from the node_modules/protractor/selenium folder.

To correct this issue the do the following:

1.       Set chromeonly setting in package.json that is located in the node_modules/protractor folder.

2.       Execute the following commands

a.      NPM install webdriver-manager

b.      NPM uninstall protractor

c.       NPM install protractor

d.      NPM install

3.       The selenium folder is now in the webdriver-manager folder so copy this folder to the node_modules/protractor folder. It should have three files chromedriver.exe,, and selenium-server-standalone-2.46.0.jar


After doing this attempt to execute the end to end test by first starting the web server via npm start command in one command window.  In another command window run npm run protractor if it produces and error stating “there’s no selenium server jar at the specified location. Do you have the correct version?” perform the following steps.

1.       Open the package.json file located in node_modules/protractor/ folder.

2.       Change all entries in the file for selenium-webdriver and selenium to the correct version number which should be 2.46.0 (in my file it was code line 19 and 61)

3.       Then start the web server via npm start

4.       Run the end to end tests via npm run protractor

*** All Content is provided As Is ***