Skip to content

Commit 1832c2b

Browse files
committed
catch Selenium::WebDriver::Error::TimeoutError
1 parent 469a3e4 commit 1832c2b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/appium_lib_core/common/base/search_context.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ def find_element(*args)
133133
by = _set_by_from_finders(how)
134134
begin
135135
bridge.find_element_by by, what.to_s, ref
136-
rescue Selenium::WebDriver::Error::TimeOutError
136+
rescue Selenium::WebDriver::Error::TimeOutError # will deprecate
137+
raise Selenium::WebDriver::Error::NoSuchElementError
138+
rescue Selenium::WebDriver::Error::TimeoutError
137139
raise Selenium::WebDriver::Error::NoSuchElementError
138140
end
139141
end
@@ -148,7 +150,9 @@ def find_elements(*args)
148150
by = _set_by_from_finders(how)
149151
begin
150152
bridge.find_elements_by by, what.to_s, ref
151-
rescue Selenium::WebDriver::Error::TimeOutError
153+
rescue Selenium::WebDriver::Error::TimeOutError # will deprecate
154+
[]
155+
rescue Selenium::WebDriver::Error::TimeoutError
152156
[]
153157
end
154158
end

0 commit comments

Comments
 (0)