flavorjones / chromedriver-helper Goto Github PK
View Code? Open in Web Editor NEWDeprecated in favor of the `webdrivers` gem.
License: MIT License
Deprecated in favor of the `webdrivers` gem.
License: MIT License
Hi,
I'm attempting to execute chromedriver in an alpine-based Docker container (as part of a test suite using Capybara).
System details as follows:
bash-4.3# rbenv version
2.3.1 (set by /root/.ruby-version)
bash-4.3# which chromedriver
/usr/local/rbenv/shims/chromedriver
bash-4.3# bundle show chromedriver-helper
/usr/local/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/chromedriver-helper-1.1.0
bash-4.3# ls -alh /root/.chromedriver-helper/2.33/linux64/chromedriver
-rwxr-xr-x 1 root root 8.5M Dec 5 08:12 /root/.chromedriver-helper/2.33/linux64/chromedriver
bash-4.3# uname -a
Linux 65a0a1bfa8f9 4.9.49-moby #1 SMP Wed Sep 27 23:17:17 UTC 2017 x86_64 Linux
When I execute bundle exec chromedriver -v
I expect to see version information in the output. Instead I get the following error:
bash-4.3# bundle exec chromedriver -v
bundler: failed to load command: chromedriver (/usr/local/rbenv/versions/2.3.1/bin/chromedriver)
Errno::ENOENT: No such file or directory - /root/.chromedriver-helper/2.33/linux64/chromedriver
/usr/local/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/chromedriver-helper-1.1.0/lib/chromedriver/helper.rb:16:in `exec'
/usr/local/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/chromedriver-helper-1.1.0/lib/chromedriver/helper.rb:16:in `run'
/usr/local/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/chromedriver-helper-1.1.0/bin/chromedriver:5:in `<top (required)>'
/usr/local/rbenv/versions/2.3.1/bin/chromedriver:23:in `load'
/usr/local/rbenv/versions/2.3.1/bin/chromedriver:23:in `<top (required)>'
As can be seen from the above output, the system is failing to detect the existence of the .chromedriver-helper
directory.
It may be worth noting that the OS as a chromedriver executable installed:
bash-4.3# /usr/bin/chromedriver -v
ChromeDriver 2.27 (94b3700c8cfd6ef738a417983f710f6ab96b8638)
However, I would expect both to be able to co-exist.
chromedriver-helper does not seem to work in a virgin docker container with a new rails application.
What follows are the step by step to:
โ docker run -it -v $PWD:/empty -w /empty ruby bash
root@4b7f2d3dc8ac:/empty# gem install rails
...
38 gems installed
root@4b7f2d3dc8ac:/empty# rails new fail_helper
...
* bin/rails: spring inserted
root@4b7f2d3dc8ac:/empty# cd fail_helper/
<<EDIT Gemfile to enable mini_racer>>
root@4b7f2d3dc8ac:/empty/fail_helper# bundle
...
Bundled gems are installed into `/usr/local/bundle`
root@4b7f2d3dc8ac:/empty/fail_helper# rails g scaffold user name:string
...
create app/assets/stylesheets/scaffolds.scss
root@4b7f2d3dc8ac:/empty/fail_helper# bin/rails db:migrate RAILS_ENV=test
== 20190111231241 CreateUsers: migrating ======================================
-- create_table(:users)
-> 0.0078s
== 20190111231241 CreateUsers: migrated (0.0079s) =============================
root@4b7f2d3dc8ac:/empty/fail_helper# apt-get update && apt-get install -y libnss3 # libnss3 is needed by chrome.
...
root@4b7f2d3dc8ac:/empty/fail_helper# bin/rails test:system
Run options: --seed 49850
# Running:
E
Error:
UsersTest#test_creating_a_User:
Selenium::WebDriver::Error::UnknownError: unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.45.615279 (12b89733300bd268cff3b78fc76cb8f3a7cc44e5),platform=Linux 4.9.125-linuxkit x86_64)
test/system/users_test.rb:14:in `block in <class:UsersTest>'
So... what happened?
root@4b7f2d3dc8ac:/empty/fail_helper# ls ~/.chromedriver-helper/2.45/linux64/chromedriver
/root/.chromedriver-helper/2.45/linux64/chromedriver
<< It got installed... >>
root@4b7f2d3dc8ac:/empty/fail_helper# /root/.chromedriver-helper/2.45/linux64/chromedriver
Starting ChromeDriver 2.45.615279 (12b89733300bd268cff3b78fc76cb8f3a7cc44e5) on port 9515
Only local connections are allowed.
[1547248893.082][SEVERE]: bind() failed: Cannot assign requested address (99)
<< It runs >>
It got installed and it runs - why is it not functioning in test:system?
I'm happy to create a project and/or dockerfile with this test case if that'd help.
Calling Chromedriver.set_version 'XXX'
in rspec config like rails_helper.rb
causes NameError: uninitialized constant Chromedriver
.
To resolve this, we need Gemfile line to be like:
gem 'chromedriver-helper', require: 'chromedriver/helper'
Environment: Rails 5.2.1, chromedriver-helper 2.0.1
Could we get a bump of chromedriver
when you get a chance? I'm running into the error outlined in this stackoverflow.
$ bin/rails test test/system/redacted/redacted-test.rb -b
Run options: -b --seed 6133
# Running:
Puma starting in single mode...
* Version 3.11.3 (ruby 2.4.3-p205), codename: Love Song
* Min threads: 0, max threads: 1
* Environment: development
* Listening on tcp://0.0.0.0:37273
Use Ctrl-C to stop
[Screenshot]: test/dummy/tmp/screenshots/redacted.png
E
Error:
Redacted::RedactedTest#redacted:
Selenium::WebDriver::Error::UnknownError: unknown error: call function result missing 'value'
(Session info: headless chrome=65.0.3325.162)
(Driver info: chromedriver=2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4),platform=Linux 4.13.0-37-generic x86_64)
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.9.0/lib/selenium/webdriver/remote/response.rb:69:in `assert_ok'
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.9.0/lib/selenium/webdriver/remote/response.rb:32:in `initialize'
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.9.0/lib/selenium/webdriver/remote/http/common.rb:81:in `new'
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.9.0/lib/selenium/webdriver/remote/http/common.rb:81:in `create_response'
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.9.0/lib/selenium/webdriver/remote/http/default.rb:104:in `request'
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.9.0/lib/selenium/webdriver/remote/http/common.rb:59:in `call'
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.9.0/lib/selenium/webdriver/remote/bridge.rb:164:in `execute'
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.9.0/lib/selenium/webdriver/remote/oss/bridge.rb:579:in `execute'
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.9.0/lib/selenium/webdriver/remote/oss/bridge.rb:267:in `execute_script'
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.9.0/lib/selenium/webdriver/common/driver.rb:211:in `execute_script'
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/capybara-2.18.0/lib/capybara/selenium/driver.rb:91:in `execute_script'
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/capybara-2.18.0/lib/capybara/selenium/node.rb:245:in `set_text'
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/capybara-2.18.0/lib/capybara/selenium/node.rb:62:in `set'
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/capybara-2.18.0/lib/capybara/node/element.rb:108:in `block in set'
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/capybara-2.18.0/lib/capybara/node/base.rb:85:in `synchronize'
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/capybara-2.18.0/lib/capybara/node/element.rb:106:in `set'
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/capybara-2.18.0/lib/capybara/node/actions.rb:92:in `fill_in'
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/capybara-2.18.0/lib/capybara/session.rb:808:in `block (2 levels) in <class:Session>'
/home/meowsus/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/capybara-2.18.0/lib/capybara/dsl.rb:50:in `block (2 levels) in <module:DSL>'
(eval):5:in `fill_in'
/home/meowsus/redacted/test/system/redacted/redacted-test.rb:40:in `redacted'
bin/rails test test/system/redacted/redacted-test.rb:9
I'm running the circleci/ruby:2.4.4-node-browsers image on CircleCI and chromedriver-helper
is pulling a weird version number on install for chromedriver
.
irb(main):012:0> helper = Chromedriver::Helper.new
=> #<Chromedriver::Helper:0x000055f8af5f3ab8>
irb(main):013:0> helper.google_code_parser.newest_download_version.to_s
=> "70.0.3538.16"
And when I run bundle exec chromedriver-helper --version
I get ChromeDriver 70.0.3538.16 (16ed95b41bb05e565b11fb66ac33c660b721f778)
.
The latest release version of chromedriver is 2.42
. When I go to https://chromedriver.storage.googleapis.com/ I do see some weird version numbers like 70.0.3538.16
which doesn't make much sense.
<Contents>
<Key>70.0.3538.16/chromedriver_linux64.zip</Key>
<Generation>1537228578852463</Generation>
<MetaGeneration>1</MetaGeneration>
<LastModified>2018-09-17T23:56:18.852Z</LastModified>
<ETag>"aa7bb2d4a516464162c97ab62d676b88"</ETag>
<Size>3637278</Size>
</Contents>
<Contents>
<Key>70.0.3538.16/chromedriver_mac64.zip</Key>
<Generation>1537228580401426</Generation>
<MetaGeneration>1</MetaGeneration>
<LastModified>2018-09-17T23:56:20.401Z</LastModified>
<ETag>"4d01ffac43d8e63a6bb334dbb99010c0"</ETag>
<Size>5935851</Size>
</Contents>
<Contents>
<Key>70.0.3538.16/chromedriver_win32.zip</Key>
<Generation>1537228581777336</Generation>
<MetaGeneration>1</MetaGeneration>
<LastModified>2018-09-17T23:56:21.776Z</LastModified>
<ETag>"ed2a5a850121af095a61b816319cf42b"</ETag>
<Size>3536229</Size>
</Contents>
Since GoogleCodeParser
is just pulling the max it's going to pull whatever is there. In the CircleCI docker file they use http://chromedriver.storage.googleapis.com/LATEST_RELEASE to grab the latest release version which does return 2.42
. Maybe that's something that can be done here?
Initially when I ran into this issue I was getting Selenium::WebDriver::Error::WebDriverError: unable to connect to chromedriver 127.0.0.1:9515
(unrelated to #57 because I had upgraded to chromedriver-helper 2.0.1 already). This may have been due to a temporary issue on Googles end with downloading the zip. Now tests are running just fine but with a weird chromedriver version.
I've been having some issues that might be related to PR #58, which changes the chromedriver
executable file name to chromedriver-helper
:
unable to connect to chromedriver 127.0.0.1:9515 (Selenium::WebDriver::Error::WebDriverError)
I'm using this outside of Rails in a standalone test suite to test an app that is developed separately; not sure if that has an impact. So my Gemfile contains:
# no rails
gem "cucumber"
gem "rspec-expectations"
gem "pry"
gem "capybara"
gem "selenium-webdriver"
gem "chromedriver-helper"
I found that Selenium::WebDriver::Chrome.driver_path was nil after trying to visit a page (after rescuing from the failure).
The problem was that I was never loading the new chromedriver-helper code to set the custom driver_path. I added this to features/support/env.rb and my scenario started working:
require 'chromedriver-helper'
Perhaps the README could mention this in the Standalone section? I did look there for how to install it.
I'm happy to submit a doc PR if this sounds helpful.
Hello,
I am wondering, does the chromedriver-helper gem automatically update the chromedriver executable version when a new latest version is detected, or must the CLI command chromedriver-update
be executed manually to trigger the update? My apologies if there was a better forum to ask this question than GH Issues. Thank you.
I have a project not using chromedriver-helper. I'm running my tests via:
bin/rails test:system
this passes. But once i bundle install
a project which uses chromedriver-helper
or i gem install chromedriver-helper
i can no longer run my tests.
gem install chromedriver-helper # or bundle install on a project using chromedriver-helper
$ bin/rails test:system
Run options: --seed 13360
# Running:
E
Error:
CustomersTest#test_login:
Selenium::WebDriver::Error::WebDriverError: unable to connect to chromedriver 127.0.0.1:9515
test/system/customers_test.rb:5:in `block in <class:CustomersTest>'
Running the chromedriver from irb shows the reason for the error:
$ bundle exec irb
2.4.0 :001 > system('chromedriver -v')
.../rubygems_integration.rb:458:in `block in replace_bin_path': can't find executable chromedriver for gem chromedriver-helper. chromedriver-helper is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
Now that Chrome 59 has been released with support for headless mode, it'd be great if chromedriver-helper used the headless mode (by default). Or at the least, documented how to enable headless mode. I realize that this may require waiting on an updated version of chromedriver itself, but I wanted to make sure we don't forget about this nice new feature.
Can I set an Authorization Header using chromedriver?
We've been getting chrome not reachable
errors in our CircleCI builds since Chrome 73 was released. It seemed like chromedriver-helper was still installing Chromedriver 2.46 as the error message showed
Selenium::WebDriver::Error::WebDriverError:
chrome not reachable
(Session info: headless chrome=73.0.3683.75)
(Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 4.10.0-35-generic x86_64)
Currently chromedriver-helper fetches the latest chromedriver version via https://chromedriver.storage.googleapis.com/LATEST_RELEASE. It's now deprecated as in the thread, and we should switch to the new way of version selection.
We are testing if updating to the matching version manually will resolve the issue for the time being:
chromedriver-update 73.0.3683.68
File name: sign_in_spec.rb
require "spec_helper"
RSpec.describe "the signin process", :type => :feature do
it "signs me in" do
visit '/'
expect(page).to have_content 'About Zeit.io'
end
end
File name: spec_helper.b
require "bundler/setup"
require "capybara/rspec"
require "selenium-webdriver"
require "frontend_end_to_end"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
config.expect_with :rspec do |c|
c.syntax = :expect
end
# config.before(:each, type: :feature) do
# # Note (Mike Coutermarsh): Make browser huge so that no content is hidden during tests
# Capybara.current_session.driver.browser.manage.window.resize_to(2_500, 2_500)
# end
end
Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(
app,
browser: :chrome,
switches: %w[--ignore-certificate-errors --disable-popup-blocking])
end
Capybara.javascript_driver = :chrome
Capybara.configure do |config|
config.default_max_wait_time = 20 # seconds
config.default_driver = :selenium
end
Capybara.app_host = 'http://127.0.0.1:8080/'
When I ran rspec spec
, got the below error:
the signin process
2017-06-27 18:42:12 WARN Selenium [DEPRECATION] :args or :switches is deprecated. Use Selenium::WebDriver::Chrome::Options#add_argument instead.
signs me in (FAILED - 1)
Failures:
1) the signin process signs me in
Failure/Error: visit '/'
Selenium::WebDriver::Error::WebDriverError:
unable to connect to chromedriver 127.0.0.1:9515
# /Users/arup/.rvm/gems/ruby-2.3.3@e2e-dockingtest-app/gems/selenium-webdriver-3.4.3/lib/selenium/webdriver/common/service.rb:130:in `connect_until_stable'
# /Users/arup/.rvm/gems/ruby-2.3.3@e2e-dockingtest-app/gems/selenium-webdriver-3.4.3/lib/selenium/webdriver/common/service.rb:74:in `block in start'
# /Users/arup/.rvm/gems/ruby-2.3.3@e2e-dockingtest-app/gems/selenium-webdriver-3.4.3/lib/selenium/webdriver/common/socket_lock.rb:41:in `locked'
# /Users/arup/.rvm/gems/ruby-2.3.3@e2e-dockingtest-app/gems/selenium-webdriver-3.4.3/lib/selenium/webdriver/common/service.rb:71:in `start'
# /Users/arup/.rvm/gems/ruby-2.3.3@e2e-dockingtest-app/gems/selenium-webdriver-3.4.3/lib/selenium/webdriver/chrome/driver.rb:52:in `initialize'
# /Users/arup/.rvm/gems/ruby-2.3.3@e2e-dockingtest-app/gems/selenium-webdriver-3.4.3/lib/selenium/webdriver/common/driver.rb:46:in `new'
# /Users/arup/.rvm/gems/ruby-2.3.3@e2e-dockingtest-app/gems/selenium-webdriver-3.4.3/lib/selenium/webdriver/common/driver.rb:46:in `for'
# /Users/arup/.rvm/gems/ruby-2.3.3@e2e-dockingtest-app/gems/selenium-webdriver-3.4.3/lib/selenium/webdriver.rb:86:in `for'
# /Users/arup/.rvm/gems/ruby-2.3.3@e2e-dockingtest-app/gems/capybara-2.14.3/lib/capybara/selenium/driver.rb:23:in `browser'
# /Users/arup/.rvm/gems/ruby-2.3.3@e2e-dockingtest-app/gems/capybara-2.14.3/lib/capybara/selenium/driver.rb:67:in `visit'
# /Users/arup/.rvm/gems/ruby-2.3.3@e2e-dockingtest-app/gems/capybara-2.14.3/lib/capybara/session.rb:269:in `visit'
# /Users/arup/.rvm/gems/ruby-2.3.3@e2e-dockingtest-app/gems/capybara-2.14.3/lib/capybara/dsl.rb:50:in `block (2 levels) in <module:DSL>'
# ./spec/signin_spec.rb:6:in `block (2 levels) in <top (required)>'
Finished in 20.27 seconds (files took 0.55112 seconds to load)
2 examples, 1 failure
Failed examples:
rspec ./spec/signin_spec.rb:5 # the signin process signs me in
/Users/arup/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/net/http.rb:882:in `rescue in block in connect': Failed to open TCP connection to 127.0.0.1:9515 (Connection refused - connect(2) for "127.0.0.1" port 9515) (Errno::ECONNREFUSED)
from /Users/arup/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/net/http.rb:879:in `block in connect'
from /Users/arup/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/timeout.rb:91:in `block in timeout'
from /Users/arup/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/timeout.rb:101:in `timeout'
from /Users/arup/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/net/http.rb:878:in `connect'
from /Users/arup/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/net/http.rb:863:in `do_start'
from /Users/arup/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/net/http.rb:852:in `start'
from /Users/arup/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/net/http.rb:584:in `start'
from /Users/arup/.rvm/gems/ruby-2.3.3@e2e-dockingtest-app/gems/selenium-webdriver-3.4.3/lib/selenium/webdriver/common/service.rb:93:in `connect_to_server'
from /Users/arup/.rvm/gems/ruby-2.3.3@e2e-dockingtest-app/gems/selenium-webdriver-3.4.3/lib/selenium/webdriver/common/service.rb:116:in `stop_server'
from /Users/arup/.rvm/gems/ruby-2.3.3@e2e-dockingtest-app/gems/selenium-webdriver-3.4.3/lib/selenium/webdriver/common/service.rb:79:in `stop'
from /Users/arup/.rvm/gems/ruby-2.3.3@e2e-dockingtest-app/gems/selenium-webdriver-3.4.3/lib/selenium/webdriver/common/service.rb:69:in `block in start'
from /Users/arup/.rvm/gems/ruby-2.3.3@e2e-dockingtest-app/gems/selenium-webdriver-3.4.3/lib/selenium/webdriver/common/platform.rb:138:in `block in exit_hook'
I am on macos sierra.
Ruby version is: ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16]
My gemspec
looks like:
spec.add_development_dependency "bundler", "~> 1.14"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "capybara"
spec.add_development_dependency "selenium-webdriver"
spec.add_development_dependency 'chromedriver-helper', '~> 1.0'
I'm guessing that this isn't directly related to chromedriver-helper, but I just started seeing this error consistently on a project using the helper and can't seem to track down the cause, so I'm curious if anyone else is seeing it.
Both on my dev machine and CI box (both Macs, one running Lion, one running Mountain Lion), I started seeing the following error today:
Unable to either launch or connect to Chrome. Please check that ChromeDriver is up-to-date. Using Chrome binary at: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome (Selenium::WebDriver::Error::UnknownError)
Tried updating by Selenium-Webdriver gems, Chromedriver, Chrome itself, switching to Canary, etc., all to no avail. Doesn't seem to be related to my code as older versions that had passed are now failing. The weird thing is that Chrome does fire up, but it never goes to the URL for the test suite - it just hangs there with a blank page.
Anyway, out of curiosity - is anyone else seeing this or am I totally nuts? My hunch is that it's something related to a Chrome auto-update that broke the integration, but I have no way of telling whether Chrome updated itself today or not.
FWIW our build failed when 1.2.0 was released, see activeadmin/pull_requests #6644 Reverting to 1.1 fixed the build for us.
P.S. You may want to tag your 1.2 release in GitHub.
The automatic downloading (Chromedrier::Helper#download
) does not work in rspec (or maybe rspec-rails), with the following error messages:
You can stub this request with the following snippet:
stub_request(:get, "https://chromedriver.storage.googleapis.com/").
with(
headers: {
'Accept'=>'*/*',
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'User-Agent'=>'Ruby'
}).
to_return(status: 200, body: "", headers: {})
I guess this is because rspec install the HTTP stubs before calling its helpers.
If chromedriver-helper uses external commands such as curl(1)
, it should work well, I think.
Due to how items are sorted in google_code_parser.rb, downloads method, 2.9 version is considered most recent and is downloaded:
"http://chromedriver.storage.googleapis.com/2.0/chromedriver_mac32.zip"
"http://chromedriver.storage.googleapis.com/2.1/chromedriver_mac32.zip"
"http://chromedriver.storage.googleapis.com/2.10/chromedriver_mac32.zip"
"http://chromedriver.storage.googleapis.com/2.11/chromedriver_mac32.zip"
"http://chromedriver.storage.googleapis.com/2.2/chromedriver_mac32.zip"
"http://chromedriver.storage.googleapis.com/2.3/chromedriver_mac32.zip"
"http://chromedriver.storage.googleapis.com/2.4/chromedriver_mac32.zip"
"http://chromedriver.storage.googleapis.com/2.5/chromedriver_mac32.zip"
"http://chromedriver.storage.googleapis.com/2.6/chromedriver_mac32.zip"
"http://chromedriver.storage.googleapis.com/2.7/chromedriver_mac32.zip"
"http://chromedriver.storage.googleapis.com/2.8/chromedriver_mac32.zip"
"http://chromedriver.storage.googleapis.com/2.9/chromedriver_mac32.zip"
Actually, 2.11 is most recent and should be downloaded. Can you please consider fixing it?
Ahoy, Rubyists.
This issue, related to #80 (and through that, to #78 and #79), intends to:
chromedriver-helper
, and deprecating it in favor of the webdrivers
gem which has very nearly a superset of the functionality.More to follow.
Hi there,
I have not coded in Rails or used chromedriver in quite some time, and so I'm pretty far from the day-to-day needs of most users of chromedriver-helper. To be honest, there are some design decisions that need to be made, and work that needs to be done; and I don't have the well-formed opinions or the motivation that a daily user of the gem might have.
So I'm seeking someone to help maintain this gem; or even take it over entirely. Please comment on this github issue if you're interested!
Some things that need doing:
Thanks for reading.
I need to install a specific version of chromedriver, specifically 2.2.0
for use on CircleCI in my rspec test setup. Is there a way to configure this through this gem, or should I be looking elsewhere?
Is it possible to change the log directory? When used with Rails app, for instance, ./log is great place for log files.
I am using chromedriver via Capybara on a Mac. I am using Capybara 2.7.1 on a Rails 4.1.14.2 app
I was wondering if there's a way to launch it with that Developer console open so that I can fall into the debugger inside of my javascript?
If I open the console fast enough, I sometimes am able to do this successfully and actually fall into the debugger. However, I've noticed that I must do Cmd-Option-I about 4 times (or 5) times before Chrome actually opens the console. developer ๐ข . if I could launch it with the dev-console open it seems like it would fall into debugger automatically for me.
I am using 50.0.2661.102 (64-bit)
The most recent Chrome update introduced a breaking change.
So, I unsuccessfully attempted the built-in chromedriver updater.
% chromedriver-update
curl: (6) Could not resolve host: http; nodename nor servname provided, or not known
/Users/mars/.rvm/gems/ruby-1.9.3-p392/gems/chromedriver-helper-0.0.5/lib/chromedriver/helper.rb:23:in `block in download': Could not download http: (RuntimeError)
from /Users/mars/.rvm/gems/ruby-1.9.3-p392/gems/chromedriver-helper-0.0.5/lib/chromedriver/helper.rb:20:in `chdir'
from /Users/mars/.rvm/gems/ruby-1.9.3-p392/gems/chromedriver-helper-0.0.5/lib/chromedriver/helper.rb:20:in `download'
from /Users/mars/.rvm/gems/ruby-1.9.3-p392/gems/chromedriver-helper-0.0.5/lib/chromedriver/helper.rb:31:in `update'
from /Users/mars/.rvm/gems/ruby-1.9.3-p392/gems/chromedriver-helper-0.0.5/bin/chromedriver-update:5:in `<top (required)>'
from /Users/mars/.rvm/gems/ruby-1.9.3-p392/bin/chromedriver-update:19:in `load'
from /Users/mars/.rvm/gems/ruby-1.9.3-p392/bin/chromedriver-update:19:in `<main>'
from /Users/mars/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/mars/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
As a workaround, I manually downloaded & copied the newest chromedriver
over the old one.
When run via capybara, raises:
Selenium::WebDriver::Error::WebDriverError: proxy must be of type dictionary, not null. Received: null
Using chromedriver version linux64_18.0.1022.0
I just upgraded an existing Rails app to chromedriver-helper 2.0, and upon running my app I get this error:
bundler-1.16.4/lib/bundler/runtime.rb:84:in `rescue in block (2 levels) in require':
There was an error while trying to load the gem 'chromedriver-helper'.
Gem Load Error is: uninitialized constant Selenium
Backtrace for gem load error is:
chromedriver-helper-2.0.0/lib/chromedriver-helper.rb:1:in `<top (required)>'
Workaround: place the chromedriver-helper
gem after selenium in app's Gemfile. E.g.
group :test do
gem "selenium-webdriver"
gem "chromedriver-helper" # must load after selenium
end
Currently, chromedriver-helper supports 64-bit and 32-bit Linux, MS Windows, and OSX.
When installed on a FreeBSD system, it breaks Chromedriver by overriding system Chromedriver with a broken .rbenv shim.
Possible fixes include a combination of:
I suspect either (1) or (2) is worthwhile, regardless of whether (3) is implemented.
There's currently something weird going on where there's a folder on the Chromedriver google storage folder that seems out of sync with the rest of the Chromedriver versions (70.0.3538.16 vs 2.42 which should be latest). This tool picks up 70.0.3538.16 as the latest version, rather than 2.42 as specified in the LATEST_RELEASE file.
I'm trying to run chromedriver-update
but I get the following error. Anything I could try to correct this? I was able to install chromedriver manually because they allowed an option for passing the following argument --no-certificate-check
Also not sure if it is relevant, but I'm working within Windows' WSL Ubuntu.
daveomcd@mcdonald-PC9020:~/rails_projects/sample$ chromedriver-update
Traceback (most recent call last):
19: from /home/daveomcd/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:15:in `<main>'
18: from /home/daveomcd/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:15:in `eval'
17: from /home/daveomcd/.rvm/gems/ruby-2.5.1/bin/chromedriver-update:23:in `<main>'
16: from /home/daveomcd/.rvm/gems/ruby-2.5.1/bin/chromedriver-update:23:in `load'
15: from /home/daveomcd/.rvm/gems/ruby-2.5.1/gems/chromedriver-helper-2.1.0/bin/chromedriver-update:5:in `<top (required)>'
14: from /home/daveomcd/.rvm/gems/ruby-2.5.1/gems/chromedriver-helper-2.1.0/lib/chromedriver/helper.rb:42:in `update'
13: from /home/daveomcd/.rvm/gems/ruby-2.5.1/gems/chromedriver-helper-2.1.0/lib/chromedriver/helper.rb:63:in `google_code_parser'
12: from /home/daveomcd/.rvm/gems/ruby-2.5.1/gems/chromedriver-helper-2.1.0/lib/chromedriver/helper.rb:63:in `new'
11: from /home/daveomcd/.rvm/gems/ruby-2.5.1/gems/chromedriver-helper-2.1.0/lib/chromedriver/helper/google_code_parser.rb:14:in `initialize'
10: from /home/daveomcd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/open-uri.rb:165:in `open_uri'
9: from /home/daveomcd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/open-uri.rb:224:in `open_loop'
8: from /home/daveomcd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/open-uri.rb:224:in `catch'
7: from /home/daveomcd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/open-uri.rb:226:in `block in open_loop'
6: from /home/daveomcd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/open-uri.rb:755:in `buffer_open'
5: from /home/daveomcd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/open-uri.rb:337:in `open_http'
4: from /home/daveomcd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/net/http.rb:909:in `start'
3: from /home/daveomcd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/net/http.rb:920:in `do_start'
2: from /home/daveomcd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/net/http.rb:981:in `connect'
1: from /home/daveomcd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/net/protocol.rb:44:in `ssl_socket_connect'
/home/daveomcd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/net/protocol.rb:44:in `connect_nonblock': SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate in certificate chain) (OpenSSL::SSL::SSLError)
If you want to run a specific version of chromedriver in your project, you can set the version in you testing setup like so:
Chromedriver.set_version "2.24"
Where is the in you testing setup
? per the README.
โ ~ ruby --version
ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-freebsd11.1]
โ ~ which ruby
/home/duncan/.rbenv/shims/ruby
โ ~ gem install chromedriver-helper
Successfully installed chromedriver-helper-1.1.0
Parsing documentation for chromedriver-helper-1.1.0
Done installing documentation for chromedriver-helper after 0 seconds
1 gem installed
โ ~ rbenv rehash
โ ~ chromedriver --version
/home/duncan/.chromedriver-helper/2.34/win/chromedriver.exe: 1: Syntax error: word unexpected (expecting ")")
โ ~ uname -a
FreeBSD x220 11.1-RELEASE FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017 [email protected]:/usr/obj/usr/src/sys/GENERIC amd64
I was working with a colleague to update their chromedriver and noticed that chromedriver-update
, when invoked without a version argument, no-ops if a version of chromedriver is already downloaded. This seems unintuitive. I'd expect invoking chromedriver-update
to fetch the latest version of chromedriver regardless of the currently-installed version. Is this intentional behavior? If so, even outputting a message informing the user that no update will be performed unless they remove the current version would be helpful. Or supporting an override flag to force the upgrade. Or anything except for exiting silently with no action. :)
Similar to #77, the latest release of chromedriver is incompatible with the version of Chromium on my system.
It would be great if chromedriver-helper checked the version of Chromium and chose a working version automatically.
Specifically, I have
$ chromium-browser --version
Chromium 70.0.3538.77 Built on Ubuntu , running on Ubuntu 18.10
And ran into errors like
Selenium::WebDriver::Error::SessionNotCreatedError:
session not created: Chrome version must be between 71 and 75
(Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 4.9.125-linuxkit x86_64)
Hey Mike.
I upgraded to OS X Mavericks (10.9) today.
Then bundle installed for a new project I'm working on.
When I run the chromedriver or chromedriver-update commands I get this error.
I've used chromedriver-helper in the past on other projects and installed Mavericks today. Hope I'm not offering you a red herring by mentioning that.
Curious if anyone has mentioned this to you. Let me know if there's anything I can do / more info to provide.
Hi ๐ I couldn't find any options to enable and redirect logging for chromedriver.
The chromedriver itself has --log-level
and --log-path
command line options.
So for debugging and such, it would be very helpful if there was an easy way to set these options in my spec_helper or environment.
We just had some failing builds on Semaphore CI because chromedriver-helper is installing the latest chromedriver version while Semaphore is not providing the latest Chrome. The workaround is to either install the latest Chrome or lock chromedriver to a compatible version (howto). But that will lead to an outdated chromedriver version one day. Some people also prefer to use their system's chromedriver instead of installing a new one through chromedriver-helper.
How difficult would it be to not install a new chromedriver if the system provides one already? It's how I expected this gem to work actually.
Upon installing the latest chromedriver-helper
via bundler, running rspec
produces the error "Unable to find chromedriver."
The command which chromedriver
produces no output from my terminal.
If I were to set my Gemfile to use 1.2.0, which chromedriver
produces /Users/pfong/.rvm/gems/ruby-2.5.1/bin/chromedriver
Any ideas on what might be preventing me from using chromedriver through the latest version of this gem?
After installing chromedriver helper, I see:
.rvm/gems/ruby-2.3.0/bin/chromedriver -v
ChromeDriver 2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4)
When I try to load it from my code, it returns an EOFError. Manually upgrading the chromedriver binary to ChromeDriver 2.25.426935 (820a95b0b81d33e42712f9198c215f703412e1a1) fixed the problem.
Can we update chromedriver-helper to use latest binary?
I called Chromedriver.set_version "2.36"
in spec helper files and also chromedriver-update 2.36
in terminal.
ls ~/.chromedriver-helper
shows 2.35 2.36
but when I run the specs I run into this issue:
Selenium::WebDriver::Error::UnknownError:
unknown error: call function result missing 'value'
(Session info: headless chrome=65.0.3325.181)
(Driver info: chromedriver=2.34.522913 (36222509aa6e819815938cbf2709b4849735537c),platform=Linux 4.13.0-38-generic x86_64)
The above issue seems to happen in versions before 2.34 but I don't have this version in ~/.chromedriver-helper
.
So I don't even see where 2.34 might come from so maybe you have an idea regarding this issue?
As this is a desktop system, there is a regular chrome browser running but I also have chromedriver 2.36 explicitely running in another tab:
$ chromedriver
Starting ChromeDriver 2.36.540471 (9c759b81a907e70363c6312294d30b6ccccc2752) on port 9515
Only local connections are allowed.
Thank you in advance!
Currently it only downloads chromedriver binary. It doesn't work on CentOS 6.6 as is. We need to download newer libstdc++ add a proxy script that sets LD_LIBRARY_PATH.
Here's how it's done in Chrome:
http://chrome.richardlloyd.org.uk/
Hi, chromedriver-helper didn't work for me on OS X. Instead, brew install chromedriver
worked fine. Sorry, I'm not sure how to debug the problem, but I wanted to let you know.
unable to connect to chromedriver http://127.0.0.1:9515 (Selenium::WebDriver::Error::WebDriverError)
/Users/dan/.rvm/gems/ruby-2.1.2/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/chrome/service.rb:50:in `start'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/chrome/bridge.rb:15:in `initialize'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/common/driver.rb:37:in `new'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/common/driver.rb:37:in `for'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver.rb:67:in `for'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/capybara-2.4.1/lib/capybara/selenium/driver.rb:13:in `browser'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/capybara-2.4.1/lib/capybara/selenium/driver.rb:69:in `find_xpath'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/capybara-2.4.1/lib/capybara/node/base.rb:107:in `find_xpath'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/capybara-2.4.1/lib/capybara/query.rb:110:in `block in resolve_for'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/capybara-2.4.1/lib/capybara/node/base.rb:80:in `synchronize'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/capybara-2.4.1/lib/capybara/query.rb:106:in `resolve_for'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/capybara-2.4.1/lib/capybara/node/matchers.rb:122:in `block in assert_no_selector'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/capybara-2.4.1/lib/capybara/node/base.rb:84:in `synchronize'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/capybara-2.4.1/lib/capybara/node/matchers.rb:121:in `assert_no_selector'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/capybara-2.4.1/lib/capybara/session.rb:675:in `block (2 levels) in <class:Session>'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/capybara-2.4.1/lib/capybara/session.rb:104:in `reset!'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/capybara-2.4.1/lib/capybara.rb:257:in `block in reset_sessions!'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/capybara-2.4.1/lib/capybara.rb:257:in `each'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/capybara-2.4.1/lib/capybara.rb:257:in `reset_sessions!'
/Users/dan/.rvm/gems/ruby-2.1.2/gems/capybara-2.4.1/lib/capybara/cucumber.rb:8:in `After'
Also:
$ chromedriver-update
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: http
/Users/dan/.rvm/gems/ruby-2.1.2/gems/chromedriver-helper-0.0.5/lib/chromedriver/helper.rb:23:in `block in download': Could not download http: (RuntimeError)
from /Users/dan/.rvm/gems/ruby-2.1.2/gems/chromedriver-helper-0.0.5/lib/chromedriver/helper.rb:20:in `chdir'
from /Users/dan/.rvm/gems/ruby-2.1.2/gems/chromedriver-helper-0.0.5/lib/chromedriver/helper.rb:20:in `download'
from /Users/dan/.rvm/gems/ruby-2.1.2/gems/chromedriver-helper-0.0.5/lib/chromedriver/helper.rb:31:in `update'
from /Users/dan/.rvm/gems/ruby-2.1.2/gems/chromedriver-helper-0.0.5/bin/chromedriver-update:5:in `<top (required)>'
from /Users/dan/.rvm/gems/ruby-2.1.2/bin/chromedriver-update:23:in `load'
from /Users/dan/.rvm/gems/ruby-2.1.2/bin/chromedriver-update:23:in `<main>'
from /Users/dan/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
from /Users/dan/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'
Great work folks! Any plans for this update? Or should I just use chromedriver-update?
I've recently installed Rails on windows 10 and it's working but when I run rake test
on any project, it gives me this error:
Selenium::WebDriver::Error::WebDriverError: not executable: "C:/Ruby24-
x64/lib/ruby/gems/2.4.0/gems/chromedriver-helper-2.1.0/bin/chromedriver-helper"
H:/Depot/config/application.rb:7:in `<top (required)>'
H:/Depot/Rakefile:4:in `require_relative'
H:/Depot/Rakefile:4:in `<top (required)>'
And I couldn't figure out what might be causing this error. Or reasons why/when chromedriver-helper fails to be executed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.