Search code examples
angularjsselenium-webdriverprotractorangularjs-e2e

Protractor e2e throwing webdriver is not defined


I had my protractor running untill few days ago when i started encountering:

Using the selenium server at http://localhost:4444/wd/hub
 **** UNCAUGHT EXCEPTION ****
Error: connect ECONNREFUSED
    at exports._errnoException (util.js:682:11)
    at Object.afterConnect [as oncomplete] (net.js:947:19)
 ****************************
 **** UNCAUGHT EXCEPTION ****
Error: socket hang up
    at createHangUpError (_http_client.js:182:15)
    at Socket.socketCloseListener (_http_client.js:214:23)
    at Socket.EventEmitter.emit (events.js:120:20)
    at TCP.close (net.js:459:12)
 ****************************

on further digging using my custom callback method e.message printed:

Error:: webdriver is not defined

/home/workspace/desktop/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1702
      throw error;
            ^
ReferenceError: webdriver is not defined

I tried installing selenium web driver using npm install selenium-webdriver but this did not help, also tried npm install for protractor but nothing seems to work here

Any help in this regard is highly appreciated.

-Vaibhav


Solution

  • I have found the solution to it however not very convinced about the reasoning. My node version was latest and when I switched to node version v0.10.26 the e2e protractor test cases started working again.