I'm having the same issue. The code works with previous iOS Versions (iOS 16, iOS 15 and iOS 14). The code is pretty simple, only allows the app to use Network:
addUIInterruptionMonitor(withDescription: "Generic Alert Handler") { element in
let button = element.buttons.element(boundBy: 1)
if button.exists {
button.tap()
}
return true
}
When I run the XCUITest using iOS 17 (17.0.3) and Xcode Version 15.0 (15A240d), I'm getting the next:
Find: Descendants matching predicate identifier == "NotificationShortLookView" OR elementType == 7
t = 33.05s Failed to construct element query matching interruption. Interrupting element Alert, foreground application Application 'com.apple.springboard', element application: (null). If your test failed after this unhandled interruption, please file a bug and attach your .xcresult bundle.
The interruption does not allow to continue with the test and it fails. Also, there is a clear null value in element application: (null).