Contents

children(matching:)

Returns a new query that matches all direct children of the requested type.

Declaration

func children(matching type: XCUIElement.ElementType) -> XCUIElementQuery

Parameters

  • type:

    The element type to match.

Return Value

A new query that defines a search that extends the search criteria of the receiver. The new search finds all direct children of elements that match the original search and are of the requested type. For a list of the types, see XCUIElement.ElementType.

Discussion

If you need to match all descendants including elements that aren’t direct child elements, use the descendants(matching:) method.

See Also

Creating new queries