Skip to content

Commit

Permalink
catch Selenium::WebDriver::Error::TimeoutError
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa committed Apr 25, 2019
1 parent 469a3e4 commit 1832c2b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/appium_lib_core/common/base/search_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ def find_element(*args)
by = _set_by_from_finders(how)
begin
bridge.find_element_by by, what.to_s, ref
rescue Selenium::WebDriver::Error::TimeOutError
rescue Selenium::WebDriver::Error::TimeOutError # will deprecate
raise Selenium::WebDriver::Error::NoSuchElementError
rescue Selenium::WebDriver::Error::TimeoutError
raise Selenium::WebDriver::Error::NoSuchElementError
end
end
Expand All @@ -148,7 +150,9 @@ def find_elements(*args)
by = _set_by_from_finders(how)
begin
bridge.find_elements_by by, what.to_s, ref
rescue Selenium::WebDriver::Error::TimeOutError
rescue Selenium::WebDriver::Error::TimeOutError # will deprecate
[]
rescue Selenium::WebDriver::Error::TimeoutError
[]
end
end
Expand Down

0 comments on commit 1832c2b

Please sign in to comment.