mllrsohn / gulp-protractor

gulp wrapper for protractor tests
MIT License
136 stars 82 forks source link

Unable to create session #138

Open elsticky opened 6 years ago

elsticky commented 6 years ago

When trying to start my gulp task using gulp-protractor I get the following error:

Using the selenium server at http://localhost:4444/wd/hub [launcher] Running 1 instances of WebDriver

/home/nlie/dev/ts-gui/nms-conf-gui/node_modules/gulp-protractor/node_modules/selenium-webdriver/lib/atoms/error.js:108 var template = new Error(this.message); ^ SessionNotCreatedError: Unable to create session from org.openqa.selenium.remote.NewSessionPayload@12a45fd2 Build info: version: '3.9.1', revision: '63f7b50', time: '2018-02-07T22:42:28.403Z' System info: host: 'PC-1705', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-112-generic', java.version: '1.8.0_131' Driver info: driver.version: unknown at new bot.Error (/home/nlie/dev/ts-gui/nms-conf-gui/node_modules/gulp-protractor/node_modules/selenium-webdriver/lib/atoms/error.js:108:18) at Object.bot.response.checkResponse (/home/nlie/dev/ts-gui/nms-conf-gui/node_modules/gulp-protractor/node_modules/selenium-webdriver/lib/atoms/response.js:109:9) at /home/nlie/dev/ts-gui/nms-conf-gui/node_modules/gulp-protractor/nodemodules/selenium-webdriver/lib/webdriver/webdriver.js:160:24 at wrappedCtr.invokeCallback (/home/nlie/dev/ts-gui/nms-conf-gui/node_modules/gulp-protractor/nodemodules/selenium-webdriver/lib/goog/../webdriver/promise.js:1337:14) at wrappedCtr.execute (/home/nlie/dev/ts-gui/nms-conf-gui/node_modules/gulp-protractor/nodemodules/selenium-webdriver/lib/goog/../webdriver/promise.js:2776:14) at wrappedCtr.executeNext (/home/nlie/dev/ts-gui/nms-conf-gui/node_modules/gulp-protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2758:21) at goog.async.run.processWorkQueue (/home/nlie/dev/ts-gui/nms-conf-gui/node_modules/gulp-protractor/node_modules/selenium-webdriver/lib/goog/async/run.js:124:15) at at process._tickCallback (internal/process/nexttick.js:188:7) From: Task: WebDriver.createSession() at Function.webdriver.WebDriver.acquireSession (/home/nlie/dev/ts-gui/nms-conf-gui/node_modules/gulp-protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:157:22) at Function.webdriver.WebDriver.createSession (/home/nlie/dev/ts-gui/nms-conf-gui/node_modules/gulp-protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:131:30) at Builder.build (/home/nlie/dev/ts-gui/nms-conf-gui/node_modules/gulp-protractor/node_modules/selenium-webdriver/builder.js:445:22) at HostedDriverProvider.DriverProvider.getNewDriver (/home/nlie/dev/ts-gui/nms-conf-gui/node_modules/gulp-protractor/node_modules/protractor/lib/driverProviders/driverProvider.js:38:7) at Runner.createBrowser (/home/nlie/dev/ts-gui/nms-conf-gui/node_modules/gulp-protractor/node_modules/protractor/lib/runner.js:186:37) at /home/nlie/dev/ts-gui/nms-conf-gui/node_modules/gulp-protractor/node_modules/protractor/lib/runner.js:276:21 at _fulfilled (/home/nlie/dev/ts-gui/nms-conf-gui/node_modules/gulp-protractor/node_modules/q/q.js:797:54) at self.promiseDispatch.done (/home/nlie/dev/ts-gui/nms-conf-gui/node_modules/gulp-protractor/node_modules/q/q.js:826:30) at Promise.promise.promiseDispatch (/home/nlie/dev/ts-gui/nms-conf-gui/node_modules/gulp-protractor/node_modules/q/q.js:759:13) at /home/nlie/dev/ts-gui/nms-conf-gui/node_modules/gulp-protractor/node_modules/q/q.js:525:49 [launcher] Process exited with error code 1 { [Error: protractor exited with code 1] message: 'protractor exited with code 1', showStack: false, showProperties: true, plugin: 'gulp-protractor', __safety: { toString: [Function: bound ] } }

When manually running 'protractor' from command line this one works but it seems it does not work when gulp-protractor is used. Also the webdriver-manager is started and already tried to update etc.

rahulmr commented 6 years ago

Is this Ubuntu ? I had similar issue and seems to be related to permissions on node_modules directory in your workspace. Can you try to manually run webdriver-manager update for the first time?

elsticky commented 6 years ago

Yes this is Ubuntu. Running webdriver-manager update is no problem. I can even run my protractor tests when webdriver-manager is started but only when using the command 'protractor' and not when I use the command 'gulp protractor' (which uses gulp-protractor)