Retry on stale element reference to avoid race conditions while interface is not ready yet.

This commit is contained in:
Thorsten Eckel 2018-06-03 17:10:22 +02:00
parent ba9845cb68
commit 7f4c540fa0

View file

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