1
0
Fork 0
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:
Jonas Nicklas 2011-04-10 18:25:39 +01:00
parent f2b9c75e91
commit b9f31f3004

View file

@ -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