From 56c45cb56116b339c46064602809a0e39fece238 Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Sat, 13 Apr 2024 11:45:39 -0700 Subject: [PATCH] Squash WebDriverError in selenium driver when accessing sessionStorage --- lib/capybara/selenium/driver.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/capybara/selenium/driver.rb b/lib/capybara/selenium/driver.rb index ad57ddc25..ab22fa141 100644 --- a/lib/capybara/selenium/driver.rb +++ b/lib/capybara/selenium/driver.rb @@ -348,7 +348,7 @@ def delete_all_cookies def clear_storage clear_session_storage unless options[:clear_session_storage] == false clear_local_storage unless options[:clear_local_storage] == false - rescue Selenium::WebDriver::Error::JavascriptError + rescue Selenium::WebDriver::Error::JavascriptError, Selenium::WebDriver::Error::WebDriverError # session/local storage may not be available if on non-http pages (e.g. about:blank) end