titusfortner / webdrivers

Keep your Selenium WebDrivers updated automatically
MIT License
593 stars 111 forks source link

Is webdrivers designed to support multiple selenium versions? #208

Closed luke-hill closed 3 years ago

luke-hill commented 3 years ago

Summary

Started getting failures in CI using latest webdrivers and an "old" gemfile.

gem 'addressable', '< 2.6'
gem 'capybara', '< 3.12'
gem 'nokogiri', '< 1.11'
gem 'selenium-webdriver', '< 3.13'

Debug Info

https://github.com/site-prism/site_prism/runs/2123477812

Expected Behavior

Webdrivers to run

Actual Behavior

Note, I don't test on Edge. So this is likely a minor bug.

undefined method `driver_path=' for Selenium::WebDriver::Edge::Service:Class (NoMethodError)
/home/travis/.rvm/gems/ruby-2.4.10/gems/webdrivers-4.6.0/lib/webdrivers/edgedriver.rb:114:in `<top (required)>'
/home/travis/.rvm/gems/ruby-2.4.10/gems/webdrivers-4.6.0/lib/webdrivers.rb:5:in `require'
/home/travis/.rvm/gems/ruby-2.4.10/gems/webdrivers-4.6.0/lib/webdrivers.rb:5:in `<top (required)>'
/home/travis/build/site-prism/site_prism/features/support/env.rb:8:in `require'
luke-hill commented 3 years ago

Update: Based on https://github.com/site-prism/site_prism/pull/93/commits/6468fc70c76b53df1dce30a4f6dcbe6ea92469d1 this proves that using the latest webdrivers won't work with old versions of selenium

kapoorlakshya commented 3 years ago

@luke-hill Thanks for reporting this issue. I was able to use your repo and Gemfile.low_spec to reproduce the error in v4.6, but not in v4.5, which tells me that the bug was introduced by this change. I think adding this check back will fix it:

if ::Selenium::WebDriver::Service.respond_to? :driver_path=
  ::Selenium::WebDriver::Edge::Service.driver_path = proc { ::Webdrivers::Edgedriver.update }
end

@titusfortner Any reason to not use the above?

titusfortner commented 3 years ago

Selenium 3 only supports the legacy Edge HTML, which was force removed from Windows machines last month. Selenium 4 only supports the new Chromium Edge. The Edge support in webdrivers has always been Chromium-only and previously required running off of github / trunk in order to work.

So no, there is no Edge support from webdrivers in Selenium 3, only in latest Selenium 4 beta. We can make that more explicit in the README if necessary.

luke-hill commented 3 years ago

Just catching back up to this. So the actionable bit here is advise users not to use webdrivers v4.5+ with selenium < 3.11