lib/capybara/selenium/driver_specializations/chrome_driver.rb in capybara-3.15.0 vs lib/capybara/selenium/driver_specializations/chrome_driver.rb in capybara-3.15.1

- old
+ new

@@ -38,12 +38,18 @@ private def delete_all_cookies execute_cdp('Network.clearBrowserCookies') - rescue Selenium::WebDriver::Error::UnhandledError, Selenium::WebDriver::Error::WebDriverError + rescue *cdp_unsupported_errors # If the CDP clear isn't supported do original limited clear super + end + + def cdp_unsupported_errors + ::Selenium::WebDriver.logger.suppress_deprecations do + [Selenium::WebDriver::Error::UnhandledError, Selenium::WebDriver::Error::WebDriverError] + end end def execute_cdp(cmd, params = {}) args = { cmd: cmd, params: params } result = bridge.http.call(:post, "session/#{bridge.session_id}/goog/cdp/execute", args)