<!--
{
  "availability" : [
    "Xcode: 16.3.0 -",
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "XCUIAutomation",
  "identifier" : "/documentation/XCUIAutomation/XCUIElementTypeQueryProvider",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "XCUIAutomation"
    ],
    "preciseIdentifier" : "c:objc(pl)XCUIElementTypeQueryProvider"
  },
  "title" : "XCUIElementTypeQueryProvider"
}
-->

# XCUIElementTypeQueryProvider

A type that provides ready-made queries for locating descendant UI elements.

```
@MainActor protocol XCUIElementTypeQueryProvider
```

## Overview

Accessing the properties to get queries for descendant elements on an instance of a conforming class (such as an [`XCUIElement`](/documentation/XCUIAutomation/XCUIElement) or [`XCUIElementQuery`](/documentation/XCUIAutomation/XCUIElementQuery) instance) is equivalent to calling [`descendants(matching:)`](/documentation/XCUIAutomation/XCUIElementQuery/descendants(matching:)) for the corresponding element type.

## Topics

### Finding the first matching element

[`firstMatch`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/firstMatch)

The first element that matches the query.

### Querying descendant elements

[`activityIndicators`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/activityIndicators)

A query that matches activity-indicator view elements.

[`alerts`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/alerts)

A query that matches alert view elements.

[`browsers`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/browsers)

A query that matches browser elements.

[`buttons`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/buttons)

A query that matches button control elements.

[`cells`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/cells)

A query that matches cell elements.

[`checkBoxes`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/checkBoxes)

A query that matches checkbox control elements.

[`collectionViews`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/collectionViews)

A query that matches collection view elements.

[`colorWells`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/colorWells)

A query that matches color-well elements.

[`comboBoxes`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/comboBoxes)

A query that matches combo-box control elements.

[`datePickers`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/datePickers)

A query that matches date-picker control elements.

[`decrementArrows`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/decrementArrows)

A query that matches decrement-arrow control elements.

[`dialogs`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/dialogs)

A query that matches dialog view elements.

[`disclosureTriangles`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/disclosureTriangles)

A query that matches disclosure-triangle control elements.

[`disclosedChildRows`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/disclosedChildRows)

A query that matches disclosed child row elements.

[`dockItems`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/dockItems)

A query that matches dock-item control elements.

[`drawers`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/drawers)

A query that matches drawer elements.

[`grids`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/grids)

A query that matches grid view elements.

[`groups`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/groups)

A query that matches group elements.

[`handles`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/handles)

A query that matches handle control elements.

[`helpTags`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/helpTags)

A query that matches help-tag elements.

[`icons`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/icons)

A query that matches icon elements.

[`images`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/images)

A query that matches image-view elements.

[`incrementArrows`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/incrementArrows)

A query that matches increment-arrow control elements.

[`keyboards`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/keyboards)

A query that matches keyboard elements.

[`keys`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/keys)

A query that matches key elements.

[`layoutAreas`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/layoutAreas)

A query that matches layout-area elements.

[`layoutItems`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/layoutItems)

A query that matches layout-item elements.

[`levelIndicators`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/levelIndicators)

A query that matches level-indicator elements.

[`links`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/links)

A query that matches link elements.

[`maps`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/maps)

A query that matches map-view elements.

[`mattes`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/mattes)

A query that matches matte elements.

[`menuBarItems`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/menuBarItems)

A query that matches menu bar item elements.

[`menuBars`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/menuBars)

A query that matches menu bar elements.

[`menuButtons`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/menuButtons)

A query that matches menu button elements.

[`menuItems`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/menuItems)

A query that matches menu item elements.

[`menus`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/menus)

A query that matches menu elements.

[`navigationBars`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/navigationBars)

A query that matches navigation bar elements.

[`otherElements`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/otherElements)

A query that matches other view or control elements.

[`outlineRows`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/outlineRows)

A query that matches outline row elements.

[`outlines`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/outlines)

A query that matches outline view elements.

[`pageIndicators`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/pageIndicators)

A query that matches page-indicator control elements.

[`pickerWheels`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/pickerWheels)

A query that matches picker-wheel control elements.

[`pickers`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/pickers)

A query that matches picker control elements.

[`popUpButtons`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/popUpButtons)

A query that matches popup-button control elements.

[`popovers`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/popovers)

A query that matches popover view elements.

[`progressIndicators`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/progressIndicators)

A query that matches progress-indicator control elements.

[`radioButtons`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/radioButtons)

A query that matches radio-button control elements.

[`radioGroups`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/radioGroups)

A query that matches radio group elements.

[`ratingIndicators`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/ratingIndicators)

A query that matches rating-indicator view elements.

[`relevanceIndicators`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/relevanceIndicators)

A query that matches relevance-indicator view elements.

[`rulerMarkers`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/rulerMarkers)

A query that matches ruler marker elements.

[`rulers`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/rulers)

A query that matches ruler view elements.

[`scrollBars`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/scrollBars)

A query that matches scroll bar elements.

[`scrollViews`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/scrollViews)

A query that matches scroll view elements.

[`searchFields`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/searchFields)

A query that matches search field elements.

[`secureTextFields`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/secureTextFields)

A query that matches secure text field elements.

[`segmentedControls`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/segmentedControls)

A query that matches segmented control elements.

[`sheets`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/sheets)

A query that matches sheet elements.

[`sliders`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/sliders)

A query that matches slider elements.

[`splitGroups`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/splitGroups)

A query that matches split group elements.

[`splitters`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/splitters)

A query that matches splitter elements.

[`staticTexts`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/staticTexts)

A query that matches static-text view elements.

[`statusBars`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/statusBars)

A query that matches status bar elements.

[`statusItems`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/statusItems)

A query that matches status item elements.

[`steppers`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/steppers)

A query that matches stepper elements.

[`switches`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/switches)

A query that matches switch control elements.

[`tabBars`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/tabBars)

A query that matches tab bar elements.

[`tabGroups`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/tabGroups)

A query that matches tab group elements.

[`tableColumns`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/tableColumns)

A query that matches table column elements.

[`tableRows`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/tableRows)

A query that matches table row elements.

[`tables`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/tables)

A query that matches table elements.

[`tabs`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/tabs)

A query that matches tab elements.

[`textFields`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/textFields)

A query that matches text field elements.

[`textViews`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/textViews)

A query that matches text view elements.

[`timelines`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/timelines)

A query that matches timeline view elements.

[`toggles`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/toggles)

A query that matches toggle control elements.

[`toolbarButtons`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/toolbarButtons)

A query that matches toolbar button elements.

[`toolbars`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/toolbars)

A query that matches toolbar elements.

[`touchBars`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/touchBars)

A query that matches touch bar elements.

[`valueIndicators`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/valueIndicators)

A query that matches value indicator elements.

[`webViews`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/webViews)

A query that matches web view elements.

[`windows`](/documentation/XCUIAutomation/XCUIElementTypeQueryProvider/windows)

A query that matches window elements.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)