From e137980d4d2f8569c8317e12f694806ab6b1ce2f Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Wed, 17 Apr 2019 23:03:11 -0700 Subject: [PATCH] Only W3C is supported in Selenium 4 --- lib/capybara/selenium/driver_specializations/firefox_driver.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/capybara/selenium/driver_specializations/firefox_driver.rb b/lib/capybara/selenium/driver_specializations/firefox_driver.rb index fc42c4c1..aaf44b41 100644 --- a/lib/capybara/selenium/driver_specializations/firefox_driver.rb +++ b/lib/capybara/selenium/driver_specializations/firefox_driver.rb @@ -8,7 +8,8 @@ module Capybara::Selenium::Driver::FirefoxDriver end def self.w3c?(driver) - driver.browser.capabilities.is_a?(::Selenium::WebDriver::Remote::W3C::Capabilities) + (defined?(Selenium::WebDriver::VERSION) && (Selenium::WebDriver::VERSION.to_f >= 4)) || + driver.browser.capabilities.is_a?(::Selenium::WebDriver::Remote::W3C::Capabilities) end end