Gulp Protractor: selenium webdriver exited status 1
Asked Answered
B

5

7

I've been using Bangular (an excellent MEAN stack Yeoman generator) to create a project and all was going well until I did a recent series of npm updates to the project. Now on my project (and on their project too) I get an error when running their gulp-protractor task (which worked fine in the past).

I have included full output for reference, in case it helps - error is half way down (scroll the code box):

Jamess-MacBook-Pro:test jamessherry$ gulp e2e
[10:05:48] Using gulpfile ~/sites/test/gulpfile.js
[10:05:48] Starting 'sass'...
[10:05:48] Finished 'sass' after 30 ms
[10:05:48] Starting 'inject'...
[10:05:48] gulp-inject 7 files into index.html.
[10:05:48] gulp-inject 11 files into index.html.
[10:05:48] Finished 'inject' after 80 ms
[10:05:48] Starting 'watch'...
[10:05:48] Finished 'watch' after 27 ms
[10:05:48] Starting 'nodemon'...
[10:05:48] [nodemon] 1.7.1
[10:05:48] [nodemon] to restart at any time, enter `rs`
[10:05:48] [nodemon] watching: *.*
[10:05:48] [nodemon] starting `node server/server.js`

Express server listening on port 9000, in development mode.

[10:05:49] Finished 'nodemon' after 898 ms
[10:05:49] Starting 'serve'...
[10:05:49] Finished 'serve' after 41 ms
[10:05:49] Starting 'e2e'...
[10:05:49] Finished 'e2e' after 1.51 ms
GET / 200 5.859 ms - 1854
[BS] Proxying: http://localhost:9000
[BS] Access URLs:
 ----------------------------
 Local: http://localhost:3000
 ----------------------------
    UI: http://localhost:3001
 ----------------------------
GET / 200 3.146 ms - 1854
GET /bower_components/angular/angular.js 304 3.598 ms - -
GET /bower_components/angular-route/angular-route.js 304 3.977 ms - -
GET /bower_components/angular-cookies/angular-cookies.js 304 3.671 ms - -
GET /styles/css/app.css 200 9.292 ms - 36
GET /bower_components/angular-resource/angular-resource.js 304 8.992 ms - -
GET /bower_components/angular-sanitize/angular-sanitize.js 304 2.055 ms - -
GET /bower_components/angular-animate/angular-animate.js 304 0.819 ms - -
GET /bower_components/angular-socket-io/socket.js 304 1.741 ms - -
GET /app.js 304 1.870 ms - -
GET /views/signup/signup.js 304 1.729 ms - -
GET /views/signup/signup.controller.js 304 0.322 ms - -
Starting selenium standalone server...
GET /views/login/login.js 304 1.931 ms - -
GET /views/login/login.controller.js 304 0.487 ms - -
GET /views/home/home.js 304 1.295 ms - -
GET /views/home/home.controller.js 304 1.538 ms - -
GET /services/socket/socket.service.js 304 1.754 ms - -
GET /services/socket/socket.mock.js 304 1.707 ms - -
[launcher] Running 1 instances of WebDriver
GET /services/auth/auth.js 304 1.208 ms - -
GET /directives/nav-bar/nav-bar.directive.js 304 1.355 ms - -
GET /bower_components/angular/angular.js 304 0.298 ms - -
GET /bower_components/angular-route/angular-route.js 304 0.380 ms - -
GET /bower_components/angular-cookies/angular-cookies.js 304 0.545 ms - -
GET /bower_components/angular-resource/angular-resource.js 304 1.083 ms - -
GET /bower_components/angular-sanitize/angular-sanitize.js 304 0.757 ms - -
GET /bower_components/angular-animate/angular-animate.js 304 0.287 ms - -
GET /app.js 304 0.347 ms - -
GET /views/signup/signup.js 304 0.246 ms - -
GET /views/signup/signup.controller.js 304 0.667 ms - -
GET /views/login/login.controller.js 304 0.378 ms - -
GET /views/home/home.js 304 0.447 ms - -
[launcher] Process exited with error code 1
/Users/jamessherry/sites/test/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/async/nexttick.js:41
  goog.global.setTimeout(function() { throw exception; }, 0);
                                      ^

Error: Server terminated early with status 1
    at Error (native)
    at /Users/jamessherry/sites/test/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/remote/index.js:204:18
    at promise.ControlFlow.runInFrame_ (/Users/jamessherry/sites/test/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:1857:20)
    at goog.defineClass.notify (/Users/jamessherry/sites/test/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2448:25)
    at promise.Promise.notify_ (/Users/jamessherry/sites/test/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:564:12)
    at Array.forEach (native)
    at promise.Promise.notifyAll_ (/Users/jamessherry/sites/test/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:553:15)
    at goog.async.run.processWorkQueue (/Users/jamessherry/sites/test/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/async/run.js:130:15)
    at process._tickCallback (node.js:356:9)
GET /views/home/home.controller.js 304 0.508 ms - -
[10:05:50] protractor exited with code 1
Jamess-MacBook-Pro:test 
jamessherry$ 

I'm not sure what the error code means (as in '1' means 'not passing', but what does that mean - was it tests that failed, or the did the driver crash out for some reason??

I'm pretty sure that it's an issue of packages not working well together as they are updated; I'm just hoping that someone can throw light on it, or may have experienced similar recently in some way...

Thanks

UPDATE

On initial investigation it appears that this problem doesn't occur with selenium version 2.45.0. Now, exactly where in the chain of 'gulp protractor -> protractor -> webdriver -> selenium' that error occurs is up for discussion. I think this is going to end with an automation patch being required or... :/

Burkey answered 18/10, 2015 at 9:25 Comment(0)
C
2

From angular/protractor#2638:

Try installing Java through brew cask instead of the standard .pkg:

brew cask install java
Cornu answered 28/10, 2015 at 20:56 Comment(3)
Nice work Spencer! Though I don't use brew, so I would guess it's the default OSX version of Java. Just updating Java would fix the problem?Gloxinia
Yeah, it's possible. Although I had a coworker try protractor using Java version 7, which seemed to work fine, so YMMV. I'm interested to hear whether just updating to version 8 resolves this for others.Cornu
This fixed it for me! Thanks @Spencer! :)Burkey
I
2

add directConnect: true to protractor.conf.js

Intrusion answered 24/2, 2016 at 20:27 Comment(0)
S
1

after receiving this error

node_modules/protractor/bin/protractor config/protractor.conf.js --specs ./e2e/spec.js
[14:17:54] I/launcher - Running 1 instances of WebDriver
[14:17:54] I/local - Starting selenium standalone server...
[14:17:54] E/launcher - Error: Error: Server terminated early with status 1
    at Error (native)
    at earlyTermination.catch.e (/hg/clients/ion/node_modules/protractor/node_modules/selenium-webdriver/remote/index.js:252:52)
    at process._tickCallback (internal/process/next_tick.js:103:7)
[14:17:54] E/launcher - Process exited with error code 100

I was able to run my tests after updating to use java 8

Seascape answered 16/2, 2017 at 21:20 Comment(0)
G
0

Two people on my team are having this same error (but not me for whatever reason). We're all running Protractor 2.5.1. We're all on Macs. We don't use gulp, so it's not that. Nor do we install via bower. Moving back to 2.45.0 does fix the issue, so it looks to be a WebdriverJS bug. I'll write up an issue once I get a chance to regress a bit (I don't see one on open yet).

Gloxinia answered 21/10, 2015 at 20:59 Comment(8)
Thanks @Brine. :) Could you drop a link to the ticket here when you log it?Burkey
Have you tried using the latest version of selenium server?Caballero
Sadly (well... happily), I can't reproduce the issue. So it's kinda hard for me to regress.Gloxinia
@user1775718, the bug was closed because I can't repro it, and cannot offer enough information. Feel free to regress and reopen.Gloxinia
Thanks @Brine, I was watching. I'll try to reproduce and hand it over to them. Thought the response was less than optimal - gives me no faith when the person fails to read the title and the body of the bug and then states that you didn't provide a version. Seemed more keen to close the ticket...Burkey
FWIW, I created an issue on the protractor repo: github.com/angular/protractor/issues/2638Cornu
@Cornu Good work fella!! Do you want to add it to the ticket at selenium?Burkey
@brine Do the guys who are having issues test on chrome? I've just upgraded to el capitan and got a warning about not having an sdk installed - when I went to install it I found: java.com/en/download/faq/chrome.xml I wonder if that has anything to do with it??Burkey
U
0

Yes, as said by @caner, adding directConnect: true to protractor.conf.js solves the problem; I also added chromeOnly: true to the same file. Hopefully, this is helpful.

Unthinking answered 24/6, 2016 at 8:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.