grunt-protractor-runner and Cross-Browser testing
-
21-12-2019 - |
Question
I am able to successfully run test on chrome on my current set-up, however I am unable to add other browsers to my tests. I am using the grunt module 'grunt-protractor-runner' to run my e2e tests.
Having looked around I know the grunt-protractor-runner module does support multiCapabilities, so on the face of it I would expect the simple task of editing the target config file to include multiCapabilities and update chromeOnly to false.
Although I can pass multiCapabilities, I cannot however change the chromeOnly option to 'false' and get my tests to run successfully. My errors when passing Firefox and Chrome to multiCapabilities,
Running 2 instances of WebDriver[launcher] Runner Process Exited With Error Code: 8
------------------------------------
PID: 7812 (capability: chrome #1)
------------------------------------
Using the selenium server at http://localhost:4444/wd/hub
C:\Project\node_modules\protractor\node_modules\selenium- webdriver\lib\webdriver\promise.js:1702
throw error;
^
------------------------------------
PID: 6444 (capability: firefox #1)
------------------------------------
Using the selenium server at http://localhost:4444/wd/hub
C:\Project\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1702
throw error;
^
I am running my set-up on Windows 7, using grunt-protractor-runner 1.0.1, protractor 0.23.1, chromedriver 2.9, and selenium-server-standalone 2.41.0
Solution
It would seem that I've been able to resolve this problem - it related to not starting a standalone selenium server, which grunt-protractor-runner does not do on it's own.
The way around this is to either open a new console at the location of the protractor web-driver using webdriver-manager start --standalone
and running the tests using grunt-protractor-runner as before; or as I am currently, using the grunt-protractor-webdriver module and including it within the grunt task to be called.
In my protractor.conf.js file I removed chromeOnly: true
and added a multiCapabilities array of browsers.