3

I am unable to run e2e test using protractor

When I am trying to run the angular phonecat app code from https://docs.angularjs.org/tutorial

It is showing this error

Starting selenium standalone server... 
[launcher] Running 1 instances of  WebDriver [launcher] Process exited with error code 1 
events.js:85      
throw er; // Unhandled 'error' event            
^ Error: spawn java ENOENT     
at exports._errnoException (util.js:746:11)    
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)     
at child_process.js:1144:20   
at process._tickCallback (node.js:355:11)  
npm ERR! Windows_NT 6.3.9600 
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\no un" "protractor"     
npm ERR! node v0.12.7 
npm ERR! 
npm  v2.11.3 
npm ERR! code ELIFECYCLE 
npm ERR! angular-phonecat@0.0.0 protractor: `protractor test/protractor-conf.js` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the angular-phonecat@0.0.0 protractor script 'protractor test/pro 
npm ERR! This is most likely a problem with the angular-phonecat package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!     protractor test/protractor-conf.js 
npm ERR! You can get their info via: 
npm ERR!     npm owner ls angular-phonecat 
npm ERR! There is likely additional logging output above. 
npm ERR! Please include the following file with any support request: 
npm ERR!     C:\Users\xxxxx\Documents\GitHub\angular-phonecat\npm-debug.log
PIRM
  • 41
  • 1
  • 2

2 Answers2

12

You have chrome and chrome driver installed?

Try this:

In 'protractor-conf.js' remove 'chromeOnly: true,' and put 'directConnect: true,'.

you can find it in angular_phonecat\test

  • 1
    This fixed the problem for me too. Here is an explanation of what directConnect does if anyone else is curious: http://stackoverflow.com/questions/30600738/difference-running-protractor-with-without-selenium – Erikk Ross Oct 17 '15 at 00:01
1

plus, run node cmd in administrator mode. That was the missing link for me!

philn5d
  • 636
  • 7
  • 12
  • WOW. I've been ripping my hair out on this one, and so I ran a cmd prompt in admin mode. I also installed Java 8, so I'm not sure exactly what the solution was of the two steps I just took. – bob.mazzo Sep 09 '16 at 19:04