Contents

XCUIElement

A UI element in an application.

Declaration

@MainActor class XCUIElement

Overview

In macOS and iPadOS 15 and later, XCUIElement provides a way to test your app with keyboard and mouse interactions, such as typing, clicking, scrolling, and moving and pausing the pointer. In iOS, XCUIElement provides a way to test your app with gestures, such as tapping, swiping, pinching, and rotating.

Topics

Querying element state

Querying descendant elements

Typing text

Combining keystrokes

Moving the pointer

Clicking

Scrolling

Tapping and pressing

Tapping multiple times

Performing gestures

Interacting with sliders

Interacting with pickers

Calculating coordinates

Supporting types

Deprecated methods

See Also

UI elements