File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,20 @@ def wait &block
29
29
result
30
30
end
31
31
32
+ # Return the first element matching text.
33
+ # @param text [String] the text to search for
34
+ # @return [Element] the first matching element
35
+ def txt text
36
+ txts ( text ) . first
37
+ end
38
+
39
+ # Return all elements matching text.
40
+ # @param text [String] the text to search for
41
+ # @return [Array<Element>] all matching elements
42
+ def txts text
43
+ $driver. find_elements :xpath , "//*[contains(@text, '#{ text } ')]"
44
+ end
45
+
32
46
# Return the first element matching name.
33
47
# on Android name is content description
34
48
# on iOS name is the accessibility label or the text.
@@ -38,7 +52,7 @@ def name name
38
52
$driver. find_element :name , name
39
53
end
40
54
41
- # Return all element matching name.
55
+ # Return all elements matching name.
42
56
# on Android name is content description
43
57
# on iOS name is the accessibility label or the text.
44
58
# @param name [String] the name to search for
You can’t perform that action at this time.
0 commit comments