Skip to content

Commit e0dfbd8

Browse files
committed
docs: describe descendent-search syntax in advanced By README
1 parent 26719ee commit e0dfbd8

File tree

1 file changed

+15
-0
lines changed
  • src/main/java/io/appium/java_client/pagefactory

1 file changed

+15
-0
lines changed

src/main/java/io/appium/java_client/pagefactory/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,21 @@ There's a special array-style syntax for defining predicates in a Class Chain:
3232
[`value < 0`]
3333
```
3434

35+
#### Searching Descendents
36+
37+
If you replace the backticks (`) around a predicate with dollar signs ($), then
38+
the Class Chain will match against the children, grandchildren, and other
39+
descendents of each element.
40+
41+
```
42+
// Find a cell element with the label 'here'
43+
XCUIElementTypeCell[`label == 'here'`]
44+
// Find a cell element which contains SOMETHING ELSE that has the label 'here'
45+
XCUIElementTypeCell[$label == 'here'$]
46+
```
47+
48+
#### Handling Quote Marks
49+
3550
Most of the time, you can treat pairs of single quotes or double quotes
3651
interchangably. If you're searching with a string that contains quote marks,
3752
though, you'll [want to be careful](https://stackoverflow.com/q/14116217).

0 commit comments

Comments
 (0)