Retry on stale element reference to avoid race conditions while interface is not ready yet.
This commit is contained in:
parent
ba9845cb68
commit
7f4c540fa0
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue