---
title: exists
framework: XCUIAutomation
role: symbol
role_heading: Instance Property
platforms: [iOS, iPadOS, Mac Catalyst, macOS, tvOS, visionOS, watchOS, Xcode 16.3+]
path: xctest/xcuielement/exists
---

# exists

Determines if the element exists.

## Declaration

```swift
var exists: Bool { get }
```

## Discussion

This property determines if the element exists within the app’s current UI hierarchy.

> **note:** The fact that an element exists doesn’t imply that it’s hittable. Elements can exist offscreen, or exist onscreen but be hidden by another element, causing their [isHittable](../../xcuiautomation/xcuielement/ishittable.md) property to return false.

## See Also

### Querying element state

- [waitForExistence(timeout:)](../../xcuiautomation/xcuielement/waitforexistence(timeout:).md)
- [waitForNonExistence(timeout:)](../../xcuiautomation/xcuielement/waitfornonexistence(timeout:).md)
- [wait(for:toEqual:timeout:)](../../xcuiautomation/xcuielement/wait(for:toequal:timeout:).md)
- [isHittable](../../xcuiautomation/xcuielement/ishittable.md)
- [debugDescription](../../xcuiautomation/xcuielement/debugdescription.md)
