---
title: "children(matching:)"
framework: xcuiautomation
role: symbol
role_heading: Instance Method
path: "xcuiautomation/xcuielement/children(matching:)"
---

# children(matching:)

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

## Declaration

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

## See Also

### Querying descendant elements

- [descendants(matching:)](xcuiautomation/xcuielement/descendants(matching:).md)
