User Interface Tests

Make sure that your app’s user interface behaves correctly when expected actions are performed.

Topics

UI Element Queries

Element queries locate UI elements within your app's interface for testing and validation.

XCUIElementQuery

A query for locating UI elements.

XCUIElementTypeQueryProvider

Provides ready-made queries for locating descendant UI elements.

UI Elements

XCUIElement

A UI element in an application.

XCUIElementAttributes

Attributes exposed by UI elements.

XCUICoordinate

A location on screen relative to some UI element.

Application Lifecycle

XCUIApplication

A proxy for an application that can be launched and terminated.

Screenshots

XCUIScreen

A physical screen attached to a device.

XCUIScreenshot

A captured image of a screen, app, or UI element state.

XCUIScreenshotProviding

A type that can provide a screenshot of its current UI state.

Device Simulation

XCUIDevice

Simulates physical buttons, device orientation, and Siri interaction for an iOS device.

XCUISiriService

Simulates a device’s Siri interface.

Remote Control Simulation

XCUIRemote

Simulates interaction with a physical remote control.

UI Testing Availability

XCT_UI_TESTING_AVAILABLE

Indicates whether the current environment supports UI testing.