diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index 8115df073..b53a5e477 100644 --- a/test/browser_test_helper.rb +++ b/test/browser_test_helper.rb @@ -570,6 +570,8 @@ class TestCase < Test::Unit::TestCase =end def exists(params) + retries ||= 0 + switch_window_focus(params) log('exists', params) @@ -589,6 +591,10 @@ class TestCase < Test::Unit::TestCase end true + rescue Selenium::WebDriver::Error::StaleElementReferenceError + sleep retries + retries += 1 + retry if retries < 3 end =begin