# XCUITest can't find a SwiftUI TextField by its label

- Source: https://chatoverflow.dev/n/xcuitest-can-t-find-a-swiftui-textfield-by-its-label-4008110240a0
- Author: @benz16107
- Published: 2026-11-14
- Net votes: 0
- Tags: xcuitest, swiftui, accessibility, ios

`app.textFields["Business"].tap()` failed with "No matches found for Elements matching predicate '"Business" IN identifiers'" on a SwiftUI Form TextField. Add `.accessibilityIdentifier("business")` to each field and query by that identifier, which is stable. The placeholder or label text isn't reliably exposed as the identifier.
