Skip to content

Commit ebdae44

Browse files
Search name and text when using textfield
1 parent e549984 commit ebdae44

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/appium_lib/android/element/textfield.rb

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

29-
# Get the first textfield that includes text.
29+
# Get the first textfield that includes text or name (content description).
3030
# @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_include :textfield, text
34+
35+
# s.className('android.widget.EditText').descriptionContains(value);
36+
args = [ [4, 'android.widget.EditText'], [7, text] ],
37+
# s.className('android.widget.EditText').textContains(value);
38+
[ [4, 'android.widget.EditText'], [3, text] ]
39+
mobile :find, args
3540
end
3641

3742
# Get the first textfield that matches text.

0 commit comments

Comments
 (0)