Upgrade dependency on selenium-webdriver to match what webdriver-manager is downloading
See original GitHub issueHi there!
Protractor depends on version 3.0.1
of selenium-webdriver
, but recently webdriver-manager
started to download version 3.5.0
as this is the latest version available.
It seems to me that this version mismatch could be the root cause of issues such as #4445 and jan-molak/serenity-js#85, manifesting themselves especially around taking screenshots.
Is it possible to upgrade Protractor’s dependency on selenium-webdriver to match what webdriver-manager is downloading? @wswebcreation?
Thanks! Jan
Bug report
- Node Version:
6.10.1
- Protractor Version:
5.1.2
- Angular Version:
N/A
- Browser(s):
Chrome Version 60.0.3112.90 (Official Build) (64-bit)
- Operating System and Version
macOS 10.12.6
- Your protractor configuration file
const
glob = require('glob'),
protractor = require.resolve('protractor'),
node_modules = protractor.substring(0, protractor.lastIndexOf('node_modules') + 'node_modules'.length),
seleniumJar = glob.sync(`${node_modules}/protractor/**/selenium-server-standalone-*.jar`).pop();
exports.config = {
seleniumServerJar: seleniumJar,
// nothing crazy here, same as https://github.com/serenity-js/seed-cucumber/blob/master/protractor.conf.js
// ...
-
A relevant example test
I triggered the below errors using a test suite of several (9 to be precise) Cucumber scenarios.
-
Output from running the test
Numerous errors, for example:
Error: ECONNREFUSED connect ECONNREFUSED 192.x.x.x:57021
[chrome #01-0] Error: ECONNREFUSED connect ECONNREFUSED 192.168.1.107:57021
[chrome #01-0] at ClientRequest.<anonymous> (/path/to/project/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:238:15)
[chrome #01-0] at emitOne (events.js:96:13)
[chrome #01-0] at ClientRequest.emit (events.js:188:7)
[chrome #01-0] at Socket.socketErrorListener (_http_client.js:309:9)
[chrome #01-0] at emitOne (events.js:96:13)
[chrome #01-0] at Socket.emit (events.js:188:7)
[chrome #01-0] at emitErrorNT (net.js:1281:8)
[chrome #01-0] at _combinedTickCallback (internal/process/next_tick.js:80:11)
[chrome #01-0] at process._tickCallback (internal/process/next_tick.js:104:9)
[chrome #01-0] From: Task: WebDriver.createSession()
[chrome #01-0] at Function.createSession (/path/to/project/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:777:24)
[chrome #01-0] at Function.createSession (/path/to/project/node_modules/protractor/node_modules/selenium-webdriver/chrome.js:709:29)
[chrome #01-0] at createDriver (/path/to/project/node_modules/protractor/node_modules/selenium-webdriver/index.js:167:33)
[chrome #01-0] at Builder.build (/path/to/project/node_modules/protractor/node_modules/selenium-webdriver/index.js:623:16)
[chrome #01-0] at Local.getNewDriver (/path/to/project/node_modules/protractor/lib/driverProviders/driverProvider.ts:60:29)
[chrome #01-0] at Runner.createBrowser (/path/to/project/node_modules/protractor/lib/runner.ts:225:39)
[chrome #01-0] at ProtractorBrowser.browser_.forkNewDriverInstance (/path/to/project/node_modules/protractor/lib/runner.ts:293:33)
[chrome #01-0] at replaceBrowser (/path/to/project/node_modules/protractor/lib/runner.ts:313:33)
[chrome #01-0] at ProtractorBrowser.browser_.restartSync (/path/to/project/node_modules/protractor/lib/runner.ts:340:14)
[chrome #01-0] at ProtractorBrowser.browser_.restart (/path/to/project/node_modules/protractor/lib/runner.ts:326:25)
WebDriverError: java.net.SocketException: Connection reset by peer (connect failed)
WebDriverError: java.net.SocketException: Connection reset by peer (connect failed)
[chrome #01-0] at WebDriverError (/path/to/project/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:5)
[chrome #01-0] at Object.checkLegacyResponse (/path/to/project/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:505:15)
[chrome #01-0] at parseHttpResponse (/path/to/project/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)
[chrome #01-0] at doSend.then.response (/path/to/project/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:440:13)
[chrome #01-0] at process._tickCallback (internal/process/next_tick.js:109:7)
WebDriverError: java.io.IOException: Error writing to server
WebDriverError: java.io.IOException: Error writing to server
[chrome #01-1] at WebDriverError (/path/to/project/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:5)
[chrome #01-1] at Object.checkLegacyResponse (/path/to/project/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:505:15)
[chrome #01-1] at parseHttpResponse (/path/to/project/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)
[chrome #01-1] at doSend.then.response (/path/to/project/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:440:13)
[chrome #01-1] at process._tickCallback (internal/process/next_tick.js:109:7)
[chrome #01-1] From: Task: WebDriver.takeScreenshot()
[chrome #01-1] at thenableWebDriverProxy.schedule (/path/to/project/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:816:17)
[chrome #01-1] at thenableWebDriverProxy.takeScreenshot (/path/to/project/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:1092:17)
[chrome #01-1] at run (/path/to/project/node_modules/protractor/lib/browser.ts:66:27)
[chrome #01-1] at ProtractorBrowser.to.(anonymous function) [as takeScreenshot] (/path/to/project/node_modules/protractor/lib/browser.ts:74:12)
[chrome #01-1] at /path/to/project/node_modules/serenity-js/src/serenity-protractor/screenplay/abilities/browse_the_web.ts:42:41
[chrome #01-1] at /path/to/project/node_modules/@serenity-js/core/src/recording/async.ts:4:8
[chrome #01-1] at Object.defer (/path/to/project/node_modules/@serenity-js/core/src/recording/async.ts:3:12)
[chrome #01-1] at BrowseTheWeb.takeScreenshot (/path/to/project/node_modules/serenity-js/src/serenity-protractor/screenplay/abilities/browse_the_web.ts:42:16)
[chrome #01-1] at Photographer.photographWorkOf (/path/to/project/node_modules/serenity-js/src/serenity-protractor/stage/photographer.ts:136:36)
[chrome #01-1] at Photographer.photograph (/path/to/project/node_modules/serenity-js/src/serenity-protractor/stage/photographer.ts:114:38)
-
Steps to reproduce the bug
- Clone https://github.com/serenity-js/seed-cucumber
- Add some cucumber scenarios
- npm install/npm test
Issue Analytics
- State:
- Created 6 years ago
- Reactions:10
- Comments:5 (3 by maintainers)
Top Results From Across the Web
WebDriverManager: How to manage browser drivers easily?
So a WebDriverManager class in Selenium: automates the management of WebDriver binaries. downloads the appropriate driver binaries, if not ...
Read more >How to Update Selenium WebDriver Executables Automatically
WebDriverManager will check the version of your web browser, and then download and use the correct driver file automatically. If you want to ......
Read more >How To Use WebDriverManager In Selenium | LambdaTest
In this blog on WebDriverManager in Selenium, I will examine how WebDriverManager offers a best practice using Selenium WebDriver.
Read more >WebDriverManager Java download matching version on device
It will check the Chrome browser version first, then install/update the webdriver accordingly. It will not install or update the Chrome browser.
Read more >WebDriverManager Implementation with Selenium WebDriver.
2. As and when browser version is updated, we need to download driver executable/s that can be matched with latest browser version. 3....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If this get’s closed a new issue should be created which tracks why issues still appear in the connection between protractor and selenium server. This issue was created form the view that the automatic update caused the problem, but using 3.6.0 still gives seemingly random:
WebDriverError: java.net.SocketException: Connection reset by peer (connect failed)
errors.Somewhere after selenium-server 3.4.0 this started happening.
This issue can be closed I guess, since Protractor is now using selenium-webdriver v3.6.0 which is the latest as of today (12/07/17)