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

# XCUIElementSnapshotProviding

A method to capture a snapshot of an element’s attributes and descendant user interface hierarchy.

```
@MainActor protocol XCUIElementSnapshotProviding : NSObjectProtocol
```

## Topics

### Providing snapshots

[`func snapshot() throws -> any XCUIElementSnapshot`](/documentation/XCUIAutomation/XCUIElementSnapshotProviding/snapshot())

Returns a snapshot of an element’s attributes and descendant user interface hierarchy.

## Relationships

### Conforming Types

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

[`XCUIApplication`](/documentation/XCUIAutomation/XCUIApplication)

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

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)