From def5b9117b297c6208d16bcfd21cceb340830611 Mon Sep 17 00:00:00 2001 From: Tim Connor Date: Mon, 12 Feb 2018 11:17:36 -0800 Subject: [PATCH] Rescue SessionNotCreatedError during Capybara::Selenium::Driver#quit --- 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 c28ad135..bf3ba334 100644 --- a/lib/capybara/selenium/driver.rb +++ b/lib/capybara/selenium/driver.rb @@ -249,7 +249,7 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base def quit @browser.quit if @browser - rescue Errno::ECONNREFUSED + rescue Selenium::WebDriver::Error::SessionNotCreatedError, Errno::ECONNREFUSED # Browser must have already gone rescue Selenium::WebDriver::Error::UnknownError => e unless silenced_unknown_error_message?(e.message) # Most likely already gone