I am working on an AngularJS app, and am looking to add some automated testing to the development life cycle of the project.
After doing a bit of research, and asking on here about what frameworks would be best to use to enable the testing functionality that I require, I have decided to use Protractor as the testing framework for my app.
I am following the tutorial to try and get Protractor up and running with my application (i.e. with my existing app, not the Super Calculator application that the tutorial references), but am encountering a problem:
The way my development environment is set up, is that I am doing all of the development of the AngularJS app on my local Windows machine, and using a Unix VM (running CentOS) to serve my app's front-end using grunt
.
I have run through the setup steps in the tutorial, and have all of that set up correctly. However, on Step 0, after creating the spec.js
& conf.js
files as instructed, when I then run:
protractor conf.js
in the command line, I get the following output:
[16:18:39] I/launcher - Running 1 instances of WebDriver
[16:18:39] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[16:18:40] E/launcher - Error code: 135
[16:18:40] E/launcher - Error message: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
[16:18:40] E/launcher - Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444 at ClientRequest. (C:\Users\Elgan\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:238:15) at emitOne (events.js:96:13) at ClientRequest.emit (events.js:188:7) at Socket.socketErrorListener (_http_client.js:310:9) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at emitErrorNT (net.js:1277:8) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9)
From: Task: WebDriver.createSession() at Function.createSession (C:\Users...\webdriver.js:777:24) at Function.createSession (C:\Users...\chrome.js:709:29) at createDriver (C:\Users...\index.js:167:33) at Builder.build (C:\Users...\index.js:623:16) at Hosted.getNewDriver (C:\Users...\driverProvider.ts:60:29) at Runner.createBrowser (C:\Users...\runner.ts:225:39) at q.then.then (C:\Users...\runner.ts:391:27) at _fulfilled (C:\Users...\q.js:834:54) at self.promiseDispatch.done (C:\Users...\q.js:863:30) at Promise.promise.promiseDispatch (C:\Users...\q.js:796:13)
[16:18:40] E/launcher - Process exited with error code 135
My guess is that this is happening because of the address/ port I'm using when running it (i.e. the address/ port used on the VM)?
Would that be the case? If so, what IP address/ port should I be using? The port that I have Karma set up on is: 9876- should I be using this port, rather than the one from the tutorial (4444)? Or if not, how can I resolve this issue?
Edit
When running webdriver-manager start
, the console shows the following output:
[16:59:26] I/start - java -Dwebdriver.chrome.driver=C:\Users...\chromedriver_2.32.exe -Dwebdriver.gecko.driver=C:\Users...\geckodriver-v0.19.0.exe -jar C:\Users...\selenium-server-standalone-3.5.3.jar -port 4444
[16:59:26] I/start - seleniumProcess.pid: 11464 'java' is not recognized as an internal or external command, operable program or batch file. [16:59:27] I/start - Selenium Standalone has exited with code 1