sidorares/crmux

Cannot connect to run Selenium tests and to Chrome inspector

Opened this issue · 4 comments

When I set --remote-debugging-port=9222 using selenium-webdriver gem 3.8.0 and chromedriver-helper gem 1.1.0, which corresponds to the chromedriver-helper version 2.33.506106, I cannot get selenium to run. It errors out with Net::ReadTimeout. If I then set the port manually to 9222 in Selenium's gem files, I get the error:

Selenium::WebDriver::Error::WebDriverError:
            unable to bind to locking port 9522 within 45 seconds

Is there some pointer you could give here to get crmux working with Selenium? I can boot up crmux and Chrome's inspect, but it doesn't help anything, since Selenium can't load the web page.

the error says port 9522 - is that the port crmux is listening?

@sidorares yikes. I don't have the initial code up, but I must have typo'd for that second error. I only get the Net::ReadTimeout when I put 9222 everywhere. I tried a few different ports as well as changing the --listen option for crmux. It seems that whatever crmux is listening or working on, Selenium tries 1 port after this.

Here is my selenium log (with selenium supposed to listen to 9222, and crmux running with default settings):

2018-03-06 21:43:17 DEBUG Selenium Executing Process ["/.rvm/gems/ruby-2.3.4/bin/chromedriver", "--port=9224"]
2018-03-06 21:43:17 DEBUG Selenium polling for socket on ["127.0.0.1", 9224]
2018-03-06 21:43:17 DEBUG Selenium polling for socket on ["127.0.0.1", 9224]
2018-03-06 21:43:17 DEBUG Selenium polling for socket on ["127.0.0.1", 9224]
2018-03-06 21:43:17 DEBUG Selenium polling for socket on ["127.0.0.1", 9224]
Starting ChromeDriver 2.33.506106 (8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2) on port 9224
Only local connections are allowed.
2018-03-06 21:43:18 INFO Selenium -> POST session
2018-03-06 21:43:18 INFO Selenium >>> http://127.0.0.1:9224/session | {"desiredCapabilities":{"browserName":"chrome","version":"","platform":"ANY","javascriptEnabled":true,"cssSelectorsEnabled":true,"takesScreenshot":false,"nativeEvents":false,"rotatable":false,"loggingPrefs":{"browser":"ALL"},"chromeOptions":{"args":["--disable-infobars","--no-sandbox","--remote-debugging-port=9222","--verbose","--log-path=/tmp/chromedriver.log","--headless","--window-size=1600,2400"],"prefs":{"homepage":"about:blank","profile.default_content_settings.popups":0,"download.default_directory":"/tmp/downloads"}}},"capabilities":{"firstMatch":[{"browserName":"chrome"}]}}
2018-03-06 21:43:18 DEBUG Selenium > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=utf-8", "Content-Length"=>"616"}
2018-03-06 21:45:33 DEBUG Selenium Executing Process ["/.rvm/gems/ruby-2.3.4/bin/chromedriver", "--port=9222"]
2018-03-06 21:45:33 DEBUG Selenium polling for socket on ["127.0.0.1", 9222]
2018-03-06 21:45:33 DEBUG Selenium polling for socket on ["127.0.0.1", 9222]
2018-03-06 21:45:33 DEBUG Selenium polling for socket on ["127.0.0.1", 9222]
2018-03-06 21:45:34 DEBUG Selenium polling for socket on ["127.0.0.1", 9222]
Starting ChromeDriver 2.33.506106 (8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2) on port 9222
Only local connections are allowed.
2018-03-06 21:45:34 INFO Selenium -> POST session
2018-03-06 21:45:34 INFO Selenium >>> http://127.0.0.1:9222/session | {"desiredCapabilities":{"browserName":"chrome","version":"","platform":"ANY","javascriptEnabled":true,"cssSelectorsEnabled":true,"takesScreenshot":false,"nativeEvents":false,"rotatable":false,"loggingPrefs":{"browser":"ALL"},"chromeOptions":{"args":["--disable-infobars","--no-sandbox","--remote-debugging-port=9222","--verbose","--log-path=/tmp/chromedriver.log","--headless","--window-size=1600,2400"],"prefs":{"homepage":"about:blank","profile.default_content_settings.popups":0,"download.default_directory":"/tmp/downloads"}}},"capabilities":{"firstMatch":[{"browserName":"chrome"}]}}
2018-03-06 21:45:34 DEBUG Selenium > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=utf-8", "Content-Length"=>"616"}
2018-03-06 21:46:34 DEBUG Selenium Executing Process ["/.rvm/gems/ruby-2.3.4/bin/chromedriver", "--port=9224"]
2018-03-06 21:46:34 DEBUG Selenium polling for socket on ["127.0.0.1", 9224]
2018-03-06 21:46:34 DEBUG Selenium polling for socket on ["127.0.0.1", 9224]
2018-03-06 21:46:34 DEBUG Selenium polling for socket on ["127.0.0.1", 9224]
2018-03-06 21:46:35 DEBUG Selenium polling for socket on ["127.0.0.1", 9224]
Starting ChromeDriver 2.33.506106 (8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2) on port 9224
Only local connections are allowed.
2018-03-06 21:46:35 INFO Selenium -> POST session
2018-03-06 21:46:35 INFO Selenium >>> http://127.0.0.1:9224/session | {"desiredCapabilities":{"browserName":"chrome","version":"","platform":"ANY","javascriptEnabled":true,"cssSelectorsEnabled":true,"takesScreenshot":false,"nativeEvents":false,"rotatable":false,"loggingPrefs":{"browser":"ALL"},"chromeOptions":{"args":["--disable-infobars","--no-sandbox","--remote-debugging-port=9222","--verbose","--log-path=/tmp/chromedriver.log","--headless","--window-size=1600,2400"],"prefs":{"homepage":"about:blank","profile.default_content_settings.popups":0,"download.default_directory":"/tmp/downloads"}}},"capabilities":{"firstMatch":[{"browserName":"chrome"}]}}
2018-03-06 21:46:35 DEBUG Selenium > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=utf-8", "Content-Length"=>"616"}

if you start crmux with debug switch - does it print anything when Selenium tries to connect?

it prints nothing at all to the screen :(