34

Currently I have Protractor v.5.1.1, Node.js v.6.10.0

All protractor tests work in window console but when I try to run them from STS IDE I get below error. Of course i did 'webdriver-manager update' but it doesn't help at all. Does anyone has an idea how to resolve this problem?

Below the error respectively when I use or do not 'directConnect'

[22:21:48] I/launcher - Running 1 instances of WebDriver
[22:21:48] I/direct - Using ChromeDriver directly...
[22:21:48] E/direct - Error code: 135
[22:21:48] E/direct - Error message: Could not find update-config.json. Run    'webdriver-manager update' to download binaries.
[22:21:48] E/direct - Error: Could not find update-config.json. Run 'webdriver-manager update' to download binaries.
at IError  (D:\STS_workspace\jgh\node_modules\protractor\built\exitCodes.js:5:1)
at ProtractorError (D:\STS_workspace\jgh\node_modules\protractor\built\exitCodes.js:10:9)
at BrowserError (D:\STS_workspace\jgh\node_modules\protractor\built\exitCodes.js:51:9)
at Direct.getNewDriver (D:\STS_workspace\jgh\node_modules\protractor\built\driverProviders\direct.js:62:31)
at Runner.createBrowser (D:\STS_workspace\jgh\node_modules\protractor\built\runner.js:194:43)
at q.then.then (D:\STS_workspace\jgh\node_modules\protractor\built\runner.js:338:29)
at _fulfilled (D:\STS_workspace\jgh\node_modules\q\q.js:834:54)
at self.promiseDispatch.done (D:\STS_workspace\jgh\node_modules\q\q.js:863:30)
at Promise.promise.promiseDispatch (D:\STS_workspace\jgh\node_modules\q\q.js:796:13)
at D:\STS_workspace\jgh\node_modules\q\q.js:556:49
[22:21:48] E/launcher - Process exited with error code 135

or

[21:19:23] I/launcher - Running 1 instances of WebDriver
[21:19:23] E/local - Error code: 135
[21:19:23] E/local - Error message: No update-config.json found. Run    'webdriver-manager update' to download binaries.
[21:19:23] E/local - Error: No update-config.json found. Run 'webdriver- manager update' to download binaries.
   at IError (D:\STS_workspace\jgh\node_modules\protractor\built\exitCodes.js:5:1)
   at ProtractorError (D:\STS_workspace\jgh\node_modules\protractor\built\exitCodes.js:10:9)
   at BrowserError (D:\STS_workspace\jgh\node_modules\protractor\built\exitCodes.js:51:9)
   at Local.addDefaultBinaryLocs_ (D:\STS_workspace\jgh\node_modules\protractor\built\driverProviders\local.js:40:23)
   at Local.setupDriverEnv (D:\STS_workspace\jgh\node_modules\protractor\built\driverProviders\local.js:81:14)
   at Local.setupEnv  (D:\STS_workspace\jgh\node_modules\protractor\built\driverProviders\driverProvider.js:110:34)
   at q.then (D:\STS_workspace\jgh\node_modules\protractor\built\runner.js:334:41)
   at _fulfilled (D:\STS_workspace\jgh\node_modules\q\q.js:834:54)
   at self.promiseDispatch.done    (D:\STS_workspace\jgh\node_modules\q\q.js:863:30)
   at Promise.promise.promiseDispatch     (D:\STS_workspace\jgh\node_modules\q\q.js:796:13)
[21:19:23] E/launcher - Process exited with error code 135

My conf.js looks like:

var SpecReporter = require('jasmine-spec-reporter').SpecReporter;

exports.config = {
  //    directConnect:true,
  specs: ['spec4.js'],
 framework: 'jasmine2' ,

 onPrepare: function () {
  jasmine.getEnv().addReporter(new SpecReporter({
  spec: {
    displayStacktrace: true,
    displaySuccessesSummary: true,
    displayFailuresSummary: true,  
    displayPendingSummary: true,
    displaySpecDuration: true,     
      },

    }));
  },

  jasmineNodeOpts: {
    defaultTimeoutInterval: 25000,
    print: function () {},
},

I don't have selenium folder in the path node_modules/protractor/node_modules/webdriver-manager but I have package.json where I added "webdriver-update": "webdriver-manager update". This is the output of npm run webdriver-update:

    D:\STS_workspace\jgh>npm run webdriver-update
    npm WARN invalid config proxy="http:"  
    npm WARN invalid config Must be a full url with 'http://'
    npm WARN invalid config proxy="http:"
    npm WARN invalid config Must be a full url with 'http://'
    npm ERR! Windows_NT 10.0.14393
    npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program     Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "webdriver-update"
    npm ERR! node v6.10.0
    npm ERR! npm  v3.10.10
    npm ERR! path D:\STS_workspace\jgh\package.json
    npm ERR! code ENOENT
    npm ERR! errno -4058
    npm ERR! syscall open
    npm ERR! enoent ENOENT: no such file or directory, open 'D:\STS_workspace\jgh\package.json'
    npm ERR! enoent ENOENT: no such file or directory, open 'D:\STS_workspace\jgh\package.json'
    npm ERR! enoent This is most likely not a problem with npm itself
    npm ERR! enoent and is related to npm not being able to find a file.
    npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     D:\STS_workspace\jgh\npm-debug.log
cnishina
  • 5,016
  • 1
  • 23
  • 40
EdXX
  • 872
  • 1
  • 14
  • 32
  • What is your script for `npm run webdriver-update`? The root problem is you are not downloading your binaries. – cnishina Feb 28 '17 at 18:00
  • Just started seeing this too.. did you solve it? – guy mograbi Apr 25 '17 at 19:41
  • BTW I solved my issue. Turns out that if I add: `npm set unsafe-perm=true` my scenario works. I don't know if this is the same scenario as yours though. let me know and if it is I'll publish an answer. – guy mograbi Apr 25 '17 at 22:47

9 Answers9

54

It looks like you are either using directConnect or launching with a local driver provider (not having seleniumAddress or directConnect) in your configuration file. You need to run webdriver-manager update.

Previously I had extra flags to not download standalone or gecko with webdriver-manager update --standalone false --gecko false. This is no longer the case if you are starting via a local driver provider. You will need the selenium standalone jar file.

You could run this with a script in package.json. Something like:

"scripts": {
  "webdriver-update": "webdriver-manager update"
}

Then execute this with: npm run webdriver-update. How do you check if the binaries are there? In your project, navigate to node_modules/protractor/node_modules/webdriver-manager/selenium/. This is where the update-config.json and your downloaded binaries are located.

cnishina
  • 5,016
  • 1
  • 23
  • 40
  • -> unfortunatelly it is not my problem. I dont use directConnect. Anyway a tried your idea but still doesnt help :( – EdXX Feb 27 '17 at 08:35
  • You are using direct connect because it says so in your error log. Maybe you should add your configuration file to your question – cnishina Feb 27 '17 at 15:25
  • Okej, my mistake sorry because once I used and once not 'directConnection' but anyway I still get the error :( I updated my question - could you acquaint with it , please? – EdXX Feb 27 '17 at 20:27
  • Please see the updated answer. Also, since it sounds like your binaries are not being downloaded, please also include your `npm run webdriver-update` console output. – cnishina Feb 27 '17 at 20:48
  • 2
    The above answer worked for me, even though I was in different but similar situation. Calling "npm test" failed with the same error, even after running "webdriver-manager update" many many times. However calling "protractor config.js" directly from command line succeeded. The reason was the same root cause as described here: npm must run "webdriver-manager update" to get selenium files locally in the local project's node_modules folder. When running "webdriver-manager update" directly, it installed the selenium files globally only. – AdamE Jul 31 '17 at 23:10
  • 2
    Yes calling npm test would require that Protractor is a node dependency in your package.json. If Protractor is installed globally and not part of the package.json, this won't work because Protractor is not part of your local node_modules folder – cnishina Sep 05 '17 at 06:30
52

You can try to update it like this, it will definitely update it in node_modules/protractor :

$ ./node_modules/protractor/bin/webdriver-manager update
Ya Yura
  • 621
  • 5
  • 3
23

Just execute webdriver-manager with npx command in your project folder;

npx webdriver-manager update
Yildiray Meric
  • 660
  • 6
  • 6
2

On MacOS, I resolved this error by adding the seleniumAddress to my Protractor config file (I was previously using directConnect, so commented that out):

// directConnect: true,
// baseUrl: 'http://localhost:4000/',
seleniumAddress: 'http://localhost:4444/wd/hub/',

I now start Protractor server by running: $ webdriver-manager start

And in a different terminal window, I start tests with: $ ng e2e

beachCode
  • 3,202
  • 8
  • 36
  • 69
1

You just need to run this command and it fixes it - npm run webdriver-update it updates you webdriver in node_modules section under node_modules/protractor.

These 2 lines are the main culprits. Just try running that command and it should fix your issue.

[22:21:48] E/direct - Error message: Could not find update-config.json. Run 'webdriver-manager update' to download binaries.
[22:21:48] E/direct - Error: Could not find update-config.json. Run 'webdriver-manager update' to download binaries.

Hope that helps!

Bruno Bieri
  • 9,724
  • 11
  • 63
  • 92
Sidd Thota
  • 2,040
  • 1
  • 20
  • 24
1

I ran npx webdriver-manager update command directly inside

$\node_modules\protractor\bin and it started working as expected.

traverse to the above mentioned folder inside your e2e and run command.

0

When I installed Java and updated Java Path in Windows 10, the problem was resolved.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Lê Văn Hiếu
  • 171
  • 1
  • 6
0

In my case

npm run webdriver-manager update

updates only app\node_modules\webdriver-manager and not app\node_modules\protractor\node_modules\webdriver-manager\. No matter if I run that command directly from console or as package.json script. I had to run

npx webdriver-manager update

inside app\node_modules\protractor\node_modules\webdriver-manager\.

Another solution would be this script:

"postinstall": "node ./node_modules/protractor/node_modules/webdriver-manager update"
Dany Way
  • 1
  • 2
0

With this I am able to proceed further node node_modules/protractor/bin/webdriver-manager update

jayesh
  • 3,277
  • 1
  • 18
  • 7