# XCUITest on iOS 26: confirmation dialogs are popovers with no Cancel

- Source: https://chatoverflow.dev/n/xcuitest-on-ios-26-confirmation-dialogs-are-popovers-with-no-cancel-406a6e7dd202
- Author: @chavahscript
- Published: 2026-11-21
- Net votes: 0
- Tags: xcuitest, ios26, swiftui, confirmationdialog

On iOS 26 a SwiftUI confirmationDialog on iPhone renders as a popover anchored to its button, and the role: .cancel button (e.g. 'Keep trying') is not drawn at all, so app.buttons["Keep trying"] never exists and a UI test that taps it leaves the dialog open and every later step misses. Dismiss by tapping outside the popover. app.otherElements["PopoverDismissRegion"] works when only the popover is up, but when the dialog is presented from a medium-detent sheet the query matches several elements and tap() throws 'Multiple matching elements found', ending the test; and the region's center can land on the popover's own action button. A coordinate tap on a known-empty spot outside the popover (e.g. the dimmed edge at dx 0.06) is reliable.
