Skip to content

Commit aed2607

Browse files
Raise NoSuchElementError on find
1 parent 82dc953 commit aed2607

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/appium_lib/element/ios/generic.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ def all_ele_js predicate
107107
def find text
108108
js = first_ele_js "name contains[c] '#{text}' || label contains[c] '#{text}' || value contains[c] '#{text}'"
109109

110-
execute_script(js).first
110+
ele = execute_script(js).first
111+
raise Selenium::WebDriver::Error::NoSuchElementError, '' if ele.nil?
112+
ele
111113
end
112114

113115
# Return all elements matching text.

0 commit comments

Comments
 (0)