mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Fix intermittent failures in Selenium driver
This commit is contained in:
parent
f2b9c75e91
commit
b9f31f3004
1 changed files with 7 additions and 1 deletions
|
@ -164,7 +164,13 @@ class Capybara::Driver::Selenium < Capybara::Driver::Base
|
|||
def reset!
|
||||
# Use instance variable directly so we avoid starting the browser just to reset the session
|
||||
if @browser
|
||||
@browser.manage.delete_all_cookies
|
||||
begin
|
||||
@browser.manage.delete_all_cookies
|
||||
rescue Selenium::WebDriver::Error::UnhandledError => e
|
||||
# delete_all_cookies fails when we've previously gone
|
||||
# to about:blank, so we rescue this error and do nothing
|
||||
# instead.
|
||||
end
|
||||
@browser.navigate.to('about:blank')
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue