'Could not connect to selenium server', and 'could not request headers [...]'.
This is possibly two different bugs:
When I use selenium.start() in my code, I get ERROR: Couldn't connect to selenium server. This started happening suddenly some time back. However, when I do ./selenium-standalone start it works nicely (using Chromedriver 2.25).
Trying to work around this, I tried specifying driver version in my code, as I read that there is an issue with Chromedriver 2.23:
selenium.install({
drivers: {
chrome: {
version: '2.25'
}
}
}, (err) => {}
selenium.start({
drivers: {
chrome: {
version: '2.25'
}
}
}, (err, child) => {}
This gives me the error Could not request headers from https://chromedriver.storage.googleapis.com/2.25/chromedriver_mac32.zip (and the same happens for 2.24). However ./selenium-standalone install --drivers.chrome.version=2.25 && ./selenium-standalone start --drivers.chrome.version=2.25 works.
Deleting node_modules does not help. I'm on OS X Sierra 10.12.1, using WebdriverIO.
Are these bugs, or am I doing something terribly wrong?
I think those are bugs, I would dig into the lib and console.log
Definitely a bug. I'll look into getting this fixed up.
https://chromedriver.storage.googleapis.com/2.25/chromedriver_mac32.zip does not exist. Since chromedriver 2.23, the filename changed to use mac64 at the end. We have already done some work to use the new filenames, but this must have slipped through.
@oyvindeh I'm having trouble getting this to reproduce. Can you provide some more information to help?
- What version of
selenium-standaloneare you using? If not 5.8.0 (the latest as of right now), then please update and try again. - Can you please paste all of the output for the
selenium.start()command where you were seeing the errors?
I use selenium-standalone 5.8.0.
As for selenium-start(), the message ERROR: Couldn't connect to selenium server comes from the test runner, with no more info. Selenium itself seems to start just fine. Like already mentioned, this error does not appear when using ./selenium-standalone start.
I tried to reproduce this on another computer. Different things happens, and on the surface it seems to work fine. However, when I try to force run Chromedriver 2.23 (i.e. the version I try to avoid) through config (ref. example above), ps ax|grep selenium says [...]/node_modules/selenium-standalone/.selenium/chromedriver/2.25-x64-chromedriver --port=31616, indicating that 2.25 is used.
However, this results in another error message from the test runner. Now it says ERROR: session not created exception from unknown error: Runtime.evaluate missing 'wasThrown'. (Again, this error message comes from the test runner.) This last error message does not appear when I force run 2.24 or 2.25. ps indicates that version 2.25 is used in all three cases.
So, this is confusing: Although it looks from ps that the same version of Chromedriver is being used regardless of config, it appear to act differently. Also, it acts differently on different computers. Perhaps this is partly due to caching of something (again, deleting node_modules does not make any difference)?
I am using selenium-standalone 6.13.0 and i am getting the following when I run ./selenium-standalone install:
15:46 $ ./selenium-standalone install
----------
selenium-standalone installation starting
----------
---
selenium install:
from: https://selenium-release.storage.googleapis.com/3.8/selenium-server-standalone-3.8.1.jar
to: /Users/fodgerl/repos/webdriverio-sample/node_modules/selenium-standalone/.selenium/selenium-server/3.8.1-server.jar
---
chrome install:
from: https://chromedriver.storage.googleapis.com/2.36/chromedriver_mac64.zip
to: /Users/fodgerl/repos/webdriverio-sample/node_modules/selenium-standalone/.selenium/chromedriver/2.36-x64-chromedriver
---
firefox install:
from: https://github.com/mozilla/geckodriver/releases/download/v0.19.1/geckodriver-v0.19.1-macos.tar.gz
to: /Users/fodgerl/repos/webdriverio-sample/node_modules/selenium-standalone/.selenium/geckodriver/0.19.1-x64-geckodriver
/Users/fodgerl/repos/webdriverio-sample/node_modules/selenium-standalone/bin/selenium-standalone:111
throw err;
^
Error: Could not download https://chromedriver.storage.googleapis.com/2.36/chromedriver_mac64.zip: Error: self signed certificate in certificate chain
at Request.<anonymous> (/Users/fodgerl/repos/webdriverio-sample/node_modules/selenium-standalone/lib/install.js:386:12)
at Request.g (events.js:291:16)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at Request.onRequestError (/Users/fodgerl/repos/webdriverio-sample/node_modules/selenium-standalone/node_modules/request/request.js:845:8)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at TLSSocket.socketErrorListener (_http_client.js:310:9)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:188:7)
If I try running ./selenium-standalone start then i get the following:
15:46 $ ./selenium-standalone start
/Users/fodgerl/repos/webdriverio-sample/node_modules/selenium-standalone/bin/selenium-standalone:79
throw err;
^
Error: Missing /Users/fodgerl/repos/webdriverio-sample/node_modules/selenium-standalone/.selenium/chromedriver/2.36-x64-chromedriver
at /Users/fodgerl/repos/webdriverio-sample/node_modules/selenium-standalone/lib/check-paths-existence.js:15:20
at FSReqWrap.cb [as oncomplete] (fs.js:257:19)
This is the location where I am trying to run the command from: ~/repos/webdriverio-sample/node_modules/.bin
@rfodge the issue is due to permission because your network is not allowed to download the lib through IDE. Maybe you can try download directly and then copy them to the related path
I encounter an issue which is 'unable to connect to selenium' after running a period of time. I use 6.12.0. and the webdriver is 4.10.0. I use it to run automation test with codeceptjs. Emergency! FYI.
Please try the latest version.
Feel free to re-open if the issue persists.
Thanks!