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

# XCUIElementAttributes

Attributes exposed by UI elements.

```
@MainActor protocol XCUIElementAttributes
```

## Overview

The [`XCUIElementAttributes`](/documentation/XCUIAutomation/XCUIElementAttributes) protocol adds attribute-related functionality to the [`XCUIElement`](/documentation/XCUIAutomation/XCUIElement) class. Access these properties on an instance of [`XCUIElement`](/documentation/XCUIAutomation/XCUIElement) to query the current state of the UI element’s attributes.

> Note:
> The attributes provided by this protocol represent data exposed to the Accessibility system, and are available during query matching.

## Topics

### Identity

[`identifier`](/documentation/XCUIAutomation/XCUIElementAttributes/identifier)

The element’s accessibility identifier.

[`elementType`](/documentation/XCUIAutomation/XCUIElementAttributes/elementType)

The type of the element.

[`XCUIElement.ElementType`](/documentation/XCUIAutomation/XCUIElement/ElementType)

The types of UI elements that you find, inspect, and interact with in a UI test.

### Value

[`value`](/documentation/XCUIAutomation/XCUIElementAttributes/value)

The raw value attribute of the element.

[`placeholderValue`](/documentation/XCUIAutomation/XCUIElementAttributes/placeholderValue)

The value displayed when the element has no value.

[`title`](/documentation/XCUIAutomation/XCUIElementAttributes/title)

The title attribute of the element.

[`label`](/documentation/XCUIAutomation/XCUIElementAttributes/label)

The label attribute of the element.

### Interaction state

[`hasFocus`](/documentation/XCUIAutomation/XCUIElementAttributes/hasFocus)

The property that determines whether the element has UI focus.

[`isEnabled`](/documentation/XCUIAutomation/XCUIElementAttributes/isEnabled)

Whether or not the element is enabled for user interaction.

[`isSelected`](/documentation/XCUIAutomation/XCUIElementAttributes/isSelected)

The property that determines whether the element is selected.

### Size

[`frame`](/documentation/XCUIAutomation/XCUIElementAttributes/frame)

The frame of the element in the screen’s coordinate space.

[`horizontalSizeClass`](/documentation/XCUIAutomation/XCUIElementAttributes/horizontalSizeClass)

The horizontal size class of the element.

[`verticalSizeClass`](/documentation/XCUIAutomation/XCUIElementAttributes/verticalSizeClass)

The vertical size class of the element.

[`XCUIElement.SizeClass`](/documentation/XCUIAutomation/XCUIElement/SizeClass)

The user interface size classes you can inspect in a UI test.



---

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)