File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/main/java/io/appium/java_client/pagefactory Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,15 @@ to learn more about the general concept.
74
74
// Selector for image elements
75
75
@iOSXCUITFindBy (iOSClassChain = " **/XCUIElementTypeImage" )
76
76
77
+ // Selector for the first image element on screen
78
+ @iOSXCUITFindBy (iOSClassChain = " **/XCUIElementTypeImage[1]" )
79
+ // Selector for the second image element on screen
80
+ @iOSXCUITFindBy (iOSClassChain = " **/XCUIElementTypeImage[2]" )
81
+ // Selector for the last image element on screen
82
+ @iOSXCUITFindBy (iOSClassChain = " **/XCUIElementTypeImage[-1]" )
83
+ // Selector for the penultimate image element on screen
84
+ @iOSXCUITFindBy (iOSClassChain = " **/XCUIElementTypeImage[-2]" )
85
+
77
86
// Selector for every cell with the name 'Foo' (single quote style)
78
87
@iOSXCUITFindBy (iOSClassChain = " **/XCUIElementTypeCell[`name == 'Foo'`]" )
79
88
// Selector for every cell with the name "Foo" (double quote style)
@@ -91,6 +100,9 @@ to learn more about the general concept.
91
100
@iOSXCUITFindBy (iOSClassChain = " *" )
92
101
// Selector that'll match every leaf element on screen (watch out: this can be SLOW)
93
102
@iOSXCUITFindBy (iOSClassChain = " **/*" )
103
+
104
+ // You can place an index after a predicate: the following finds the last image element with name 'Foo'
105
+ @iOSXCUITFindBy (iOSClassChain = " **/XCUIElementTypeCell[`name == 'Foo'`][-1]" )
94
106
```
95
107
96
108
## Android's uiAutomator String
You can’t perform that action at this time.
0 commit comments