Skip to content

Commit c3adbc5

Browse files
Fix name and textfield
1 parent 5c26137 commit c3adbc5

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

lib/appium_lib/android/element/generic.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ def texts text
8080
# @param name [String] the name to search for
8181
# @return [Element] the first matching element
8282
def name name
83-
@driver.find_element :name, name
83+
# work around https://github.com/appium/appium/issues/543
84+
# @driver.find_element :name, name
85+
mobile :find, [ [ [7, name] ] ]
8486
end
8587

8688
# Return all elements matching name.

lib/appium_lib/android/element/textfield.rb

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ def last_textfield
2626
last_ele :textfield
2727
end
2828

29-
# Get the first textfield that matches text.
30-
# @param text [String, Integer] the text to match exactly. If int then the textfield at that index is returned.
29+
# Get the first textfield that includes text.
30+
# @param text [String, Integer] the text to search for. If int then the textfield at that index is returned.
3131
# @return [Textfield]
3232
def textfield text
3333
return ele_index :textfield, text if text.is_a? Numeric
34-
find_ele_by_text :textfield, text
34+
find_ele_by_text_include :textfield, text
3535
end
3636

37-
# Get the first textfield that includes text.
38-
# @param text [String] the text the textfield must include
37+
# Get the first textfield that matches text.
38+
# @param text [String] the text to match
3939
# @return [Textfield]
40-
def textfield_include text
41-
find_ele_by_text_include :textfield, text
40+
def textfield_exact text
41+
find_ele_by_text :textfield, text
4242
end
4343
end # module Appium::Android

0 commit comments

Comments
 (0)