Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect to chromedriver with 3.5.0 #4453

Closed
boris-petrov opened this issue Aug 14, 2017 · 12 comments
Closed

Unable to connect to chromedriver with 3.5.0 #4453

boris-petrov opened this issue Aug 14, 2017 · 12 comments
Labels

Comments

@boris-petrov
Copy link
Contributor

boris-petrov commented Aug 14, 2017

Since I updated to Selenium 3.5.0 (using Ruby and Capybara), the following message is displayed:

Selenium::WebDriver::Error::WebDriverError:                                    
  unable to connect to chromedriver 127.0.0.1:9515

Everything works fine with Selenium 3.4.3 (and 3.4.4 but it has another issue)

Meta -

OS: Linux
Selenium Version: 3.5.0
Browser: Chromium 60.0.3112.90
ChromeDriver version: 2.31.488763

@barancev
Copy link
Member

For issues please provide a concise reproducible test case and describe what results you are seeing and what results you expect.

See CONTRIBUTING.md

@boris-petrov
Copy link
Contributor Author

I'm not sure what more do you need. There is no test case - Capybara/Selenium fails to connect to the ChromeDriver on start (the exact code is Capybara.current_session.current_window.resize_to(1920, 1060)). Happens only with the latest Selenium. What more could I give you?

@lmtierney
Copy link
Member

You could start by sample code, using only selenium. We do not do support for Capybara. I've just tried starting Chromium with Selenium Ruby 3.5, Chromium 60.0.3112.78, and Chromedriver 2.31.488763 and it's fine.

@p0deje
Copy link
Member

p0deje commented Aug 14, 2017

I also tried the following code right now:

require 'selenium-webdriver'

driver = Selenium::WebDriver.for(:chrome)
driver.manage.window.resize_to 100, 100

It worked perfectly and resized window correctly.

ChromeDriver 2.31.488774 (7e15618d1bf16df8bf0ecf2914ed1964a387ba0b)
Google Chrome Version 60.0.3112.90 (Official Build) (64-bit)

@boris-petrov
Copy link
Contributor Author

Ok, I'll try creating a short reproduction then. I'll post it here when I'm done. Also, note we're using JRuby.

@boris-petrov
Copy link
Contributor Author

Ok, so the problem happens only when using JRuby. Have a directory with:

Gemfile

source "https://rubygems.org"

gem "selenium-webdriver"
gem "rspec"

specs/foo_spec.rb

require_relative './spec_helper'

specs/spec_helper.rb

require 'selenium-webdriver'

driver = Selenium::WebDriver.for(:chrome)
driver.manage.window.resize_to 100, 100

And run:

sudo jruby -S gem install bundler
sudo jgem install bundler
jruby -S bundle install
jruby -S rspec specs

And you will see it fail with the error I've given in the first post. Running a rspec specs instead works fine.

@p0deje
Copy link
Member

p0deje commented Aug 15, 2017

Thank you for additional report. I can reproduce the problem now.

This seems to be something related to how IO is handled in ChildProcess gem. I'll need to investigate and get back.

@p0deje
Copy link
Member

p0deje commented Aug 15, 2017

Once CI shows we're good to release, I'll make a point 3.5.1 release of gem.

Thank you again for a bug report.

@p0deje p0deje removed the D-chrome label Aug 15, 2017
@boris-petrov
Copy link
Contributor Author

@p0deje - No problem, thanks for the quick fix! Do you think this behavior of JRuby is wrong? If that's a bug, perhaps you/I could log an issue with them?

@p0deje
Copy link
Member

p0deje commented Aug 15, 2017

I'm not sure. It seems like GeckoDriver and ChromeDriver need some real I/O in order to work correctly, but not all processes require this.

@p0deje
Copy link
Member

p0deje commented Aug 15, 2017

3.5.1 is available on Rubygems, give it a try.

@boris-petrov
Copy link
Contributor Author

Works like a charm, thank you!

Tom-Trumper pushed a commit to Tom-Trumper/selenium that referenced this issue Sep 11, 2017
topherbullock pushed a commit to topherbullock/selenium that referenced this issue Oct 4, 2017
@lock lock bot locked and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants