Docker selenium / node-chrome - Transporter cannot find chrome binary

I am new to Docker, but not for the E2E transporter. I am trying to build E2E integration from docker containers.

Follow Angular Protractor Cookbook Using Docker

They Have Step 2 - Launching Selenium Nodes Using

docker run -d --link selenium-hub:hub selenium/node-chrome:latest

I understand what Selnium Grid does - it allows you to check various types of browsers by linking them to the grid.

When I have this container docker working with Protactor, it does not use it as chrome binary, and I get WebDriverError: unknown error: cannot find Chrome binary .

How to make the protractor use this node-chrome container rather than the local chrome-binary?

My protractor configuration:

 exports.config = { framework: 'mocha', directConnect: true, seleniumAddress: 'http://localhost:4444/wd/hub', // I have this set to the grid docker container from Angular cookbook specs: ['./stories/*.js'], onPrepare: function() { expect = require("chai").use(require("chai-as-promised")).expect; }, mochaOpts: { enableTimeouts: false, reporter: "spec", slow: 7000 }, capabilities: { browserName: 'chrome' } } 

This is how I run protractor on my headless server (not docker) xvfb-run node_modules/protractor/bin/protractor e2e/protractor.conf.js

+6
source share
1 answer

I found the problem ... I removed directConnect: true in the protractor configuration, and this allowed it to run without the local chrome binary. The solution is to make it false or delete.

From the docs:

directConnect: true - your test script directly communicates with the Chrome or Firefox driver, bypassing any Selenium server. If so, the settings for seleniumAddress and seleniumServerJar will be ignored. If you try to use a browser other than Chrome or Firefox, an error will be thrown.

+3
source

Source: https://habr.com/ru/post/1013559/


All Articles