Developer Blog

Tipps und Tricks für Entwickler und IT-Interessierte

JavaScript: Guide to the JavaScript Ecosystem

Beginning – Libraries and Frameworks

UI

  • Angular
  • Ionic
  • Onson UI
  • Framework 7

Unit Testing

  • Karma
  • Jasmine

End-to-End Testing

Technologies

Unit Testing

Protractor (http://www.protractortest.org/)

Use npm to install Protractor globally with

npm install -g protractor

The webdriver-manager is a helper tool to easily get an instance of a Selenium Server running. Use it to download the necessary binaries with:

webdriver-manager update

Now start up a server with:

webdriver-manager start

Install a demo repository:

git clone https://github.com/juliemr/protractor-demo.git
npm install

Update selenium driver

node_modules/protractor/bin/webdriver-manager update

Run server in background:

node app/expressserver.js &

Now run the tests

npm test 

Error message: No selenium server jar found at the specified location

The Error

If you got this error when testing your javascript app, maybe you hate to update the selenium driver jar.

The Solution

Update the driver depending on the installation of the node module:

Check with

$ which protracto
/usr/local/bin/protractor

If installed global, then use the command

$ /usr/local/lib/node_modules/protractor/bin/webdriver-manager update

If installed in the app directory, use

$ node_modules/protractor/bin/webdriver-manager update
[17:17:13] I/update - chromedriver: file exists node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.22mac32.zip
[17:17:13] I/update - chromedriver: unzipping chromedriver_2.22mac32.zip
[17:17:14] I/update - chromedriver: setting permissions to 0755 for node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.22
[17:17:14] I/update - chromedriver: v2.22 up to date
[17:17:14] I/update - selenium standalone: file exists node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar
[17:17:14] I/update - selenium standalone: v2.53.1 up to date