I'm using xcuitest framework to automate mac application. I get system dialogs when the app is opened again after it crashes. I want to handle the dialog programmatically. But the dialog appears under the process `UserNotificationCenter' instead of the application under test. How can I handle the alert in such case?
You have two options:
InterruptionMonitor
(documentation, use-case). This
approach is however kinda old and I found, that it does not work for
all dialogs and situations.UserNotificationCenter
dialog's button and identify&tap it by its string/position. I'm using the second approach and its working much better, than the InterruptionMonitor
. But it really depends on your app layout and use-case.