Dismiss system alert (like "Software-update) that is already visible before starting XCUI test

Hi,

Does anybody know how to dismiss a system alert, for example a Software-update alert, that is already visible before the actual XCUItest is started.

I've seen remarks to add a UIInterruptionMonitor, but this does not function because the popup is already visible.

We are running the tests in a remote location (because of the Covid virus) and run into problems when starting a test while a system alert is visible. At the moment we have to ask persons that can go to our test setup to dismiss the alerts, but it would be nice if these alerts can be dismissed automatically.

Thanks in advance,
Nico

Or a way to just disable these upgrade alerts altogether - they are the sole reason I still need to get in the car and drive to the location to tap a button by hand.

You may want to add a check for this type of popup from SpringBoard in your setUp method. If the popup is present, using the .exists property on XCUIElement, for instance, you should be able to dismiss it before the test begins.

Dismiss system alert (like "Software-update) that is already visible before starting XCUI test
 
 
Q