Running webdriver from an npm script fails
$ webdriver-manager start --standalone works for me, but $ npm run wd doesn't with this setup in my package.json:
"scripts": {
"test-unit": "karma start karma.conf.js",
"update-wd": "webdriver-manager update",
"wd": "webdriver-manager start --standalone",
"test-e2e": "protractor protractor.conf.js"
}
I get this error message:
$ npm run wd
> <<project name>>@0.1.0 wd <<project path>>
> webdriver-manager start --standalone
Selenium Standalone is not present. Install with webdriver-manager update --standalone
npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "run" "wd"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! <<project name>>@0.1.0 wd: `webdriver-manager start --standalone`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the <<project name>>@0.1.0 wd script 'webdriver-manager start --standalone'.
npm ERR! This is most likely a problem with the <<project name>> package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webdriver-manager start --standalone
npm ERR! You can get their info via:
npm ERR! npm owner ls <<project name>>
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! <<project path>>
did you read the output message??
(sorry.... more saying npm owner ls wd and you should know that is not this project)
@lukeis I have selenium standalone, because as I said before, when I run webdriver-manager start --standalone, I have no issues and it works just fine.
@ilanbiala ok, then log a bug against the 'wd' project
did you run your update script?
The user here named their script 'wd'. I don't think it's related to the 'wd' npm module at all.
Yes, as I said running the command itself works, but the npm alias doesn't.
try this: first you need to install update: webdriver-manager update --standalone like it says in the npm error. then in package.json do:
"scripts": { "wd": "node node_modules/webdriver-manager/bin/webdriver-manager start --standalone" }
it worked for me.