Instance Method

descendantsMatchingType:

Returns a query for all descendants of the element matching the specified type.

Declaration

- (XCUIElementQuery *)descendantsMatchingType:(XCUIElementType)type;

Discussion

Because XCUIElement conforms to the XCUIElementTypeQueryProvider protocol, you can use the protocol’s properties as shorthand for calling descendantsMatchingType: for different element types. For example, rather than calling [table descendantsMatchingType: XCUIElementTypeCell], you can use the cells property from the protocol to retrieve table.cells.

See Also

Querying Descendant Elements

- childrenMatchingType:

Returns a query for all direct children of the element matching the specified type.