Problems with chromedriver and gulp

989 views
Skip to first unread message

vickist...@gmail.com

unread,
Aug 28, 2014, 9:00:02 AM8/28/14
to chromedri...@googlegroups.com
Hello:

I am having an issue getting gulp to find chromedriver. I am a total n00b at this. I looked at the code in local.js and it is using relative pathing which is a bit confusing, but if I am right, I should have the chromedriver executable in node_modules/protractor/selenium, but that doesn't seem to work. I have tried the zip file and the exploded zip. I am obviously missing something here.

/private/var/root/ngen/client/node_modules/protractor/lib/driverProviders/local.js:42
throw new Error('Could not find chromedriver at ' +
^
Error: Could not find chromedriver at /private/var/root/ngen/client/node_modules/protractor/selenium/chromedriver.exe
at LocalDriverProvider.addDefaultBinaryLocs_ (/private/var/root/ngen/client/node_modules/protractor/lib/driverProviders/local.js:42:15)
at LocalDriverProvider.setupEnv (/private/var/root/ngen/client/node_modules/protractor/lib/driverProviders/local.js:59:8)
at Runner.run (/private/var/root/ngen/client/node_modules/protractor/lib/runner.js:234:31)
at Object.init (/private/var/root/ngen/client/node_modules/protractor/lib/launcher.js:137:12)
at Object.<anonymous> (/private/var/root/ngen/client/node_modules/protractor/lib/cli.js:129:23)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
{ [Error: protractor exited with code 8]
plugin: 'gulp-protractor',
showStack: false,
message: 'protractor exited with code 8' }
[16:04:40] 'protractor' errored after 142 ms
[16:04:40] Error in plugin 'gulp-protractor'
protractor exited with code 8

Can someone point me in the correct direction?

Captain Vic

vickist...@gmail.com

unread,
Aug 28, 2014, 9:53:45 AM8/28/14
to chromedri...@googlegroups.com, vickist...@gmail.com
More info:

ubuntu@ubuntu:~/ngen/client$ find . -name chromedriver
./node_modules/.bin/chromedriver
./node_modules/chromedriver
./node_modules/chromedriver/chromedriver
./node_modules/chromedriver/chromedriver/chromedriver
./node_modules/chromedriver/lib/chromedriver
./node_modules/chromedriver/lib/chromedriver/chromedriver
./node_modules/chromedriver/bin/chromedriver

Is this installed correctly? I used npm to install it. Why so many executables with that name?

bash-3.2# ls -l `find . -name chromedriver`
lrwxr-xr-x 1 root wheel 32 Aug 28 09:50 ./node_modules/.bin/chromedriver -> ../chromedriver/bin/chromedriver
-rwxr-xr-x 1 root wheel 398 Jun 16 21:41 ./node_modules/chromedriver/bin/chromedriver
-rw-rw-rw- 1 root wheel 11938840 Aug 28 09:50 ./node_modules/chromedriver/chromedriver/chromedriver
-rwxr-xr-x 1 root wheel 11938840 Aug 28 09:50 ./node_modules/chromedriver/lib/chromedriver/chromedriver

./node_modules/chromedriver:
total 48
-rw-r--r-- 1 root wheel 51 Jun 16 21:41 .npmignore
-rw-r--r-- 1 root wheel 127 Jun 16 21:41 .travis.yml
-rw-r--r-- 1 root wheel 2420 Jun 16 21:41 README.md
drwxr-xr-x 3 root wheel 102 Jun 16 21:41 bin
drwxr-xr-x 4 root wheel 136 Aug 28 09:50 chromedriver
-rw-r--r-- 1 root wheel 5694 Jun 16 21:41 install.js
drwxr-xr-x 4 root wheel 136 Aug 28 09:50 lib
drwxr-xr-x 7 root wheel 238 Aug 28 09:50 node_modules
-rw-r--r-- 1 root wheel 1611 Aug 28 09:50 package.json

./node_modules/chromedriver/chromedriver:
total 31360
-rw-rw-rw- 1 root wheel 11938840 Aug 28 09:50 chromedriver
-rw-r--r-- 1 root wheel 4116418 Aug 28 09:50 chromedriver_mac32.zip

./node_modules/chromedriver/lib/chromedriver:
total 31360
-rwxr-xr-x 1 root wheel 11938840 Aug 28 09:50 chromedriver
-rw-r--r-- 1 root wheel 4116418 Aug 28 09:50 chromedriver_mac32.zip

Obviously I am missing something here.

CaptainVic

jero.c...@gmail.com

unread,
Sep 15, 2014, 3:23:18 PM9/15/14
to chromedri...@googlegroups.com, vickist...@gmail.com
Hi Captain Vic! I following this article:

http://stackoverflow.com/questions/22193692/protractor-selenium-could-not-find-chromedriver-at-on-windows

And I did:

0) npm install --save-dev gulp-protractor protractor
1) Copy "protractor.conf.js" to /. (root app)
2) Copy any test within "test" folder. (Wherever you want)
3) mkdir node_module/protractor/selenium
4) npm install chromedriver
5) copy the chromedriver.exe in the following path

from: ..\MyAPP\node_modules\chromedriver\lib\chromedriver\chromedriver.exe
to: ..\MyAPP\node_modules\protractor\selenium\chromedriver.exe

Note: the selenium folder from protractor folder did not exist, You will need to make it.

And then I can execute my gulp task;

```
gulp protractor

```
**************
TASK of Gulp:
**************

'use strict';
module.exports = function (gulp) {

var protractor = require("gulp-protractor").protractor;

gulp.task("protractor", function () {
gulp.src(["app/test/navigation.js"])
.pipe(protractor({
configFile: "app/protractor.conf.js",
args: ['--baseUrl', 'http://127.0.0.1:8000']
}))
.on('error', function (e) {
console.log('ERROR::: '+JSON.stringify(e));
throw e
});
});
};

*********************
My protractor.conf.js
*********************

'use strict';
exports.config = {
// The address of a running selenium server.
seleniumAddress: 'http://localhost:4444/wd/hub',

// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome'
},

chromeOnly: true,

// URL of the app you want to test.
baseUrl: 'http://localhost:9000/',

// Spec patterns are relative to the location of the spec file. They may
// include glob patterns.
specs: ['test/navigation.js'],

// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true, // Use colors in the command line report.
isVerbose: true, // List all tests in the console
includeStackTrace: true,
defaultTimeoutInterval: 30000
}
};


NOTE: verify in 'specs' option put your test file.

I Hope this information make help to you!
Greetings,
Jero
Reply all
Reply to author
Forward
0 new messages