How to tap Push Notification UITest (Xcode 13, iOS15)?

Hi community,

my existing ui-tests did test push-notification interactions. Since upgrading to Xcode 13 those tests fail when tapping a by the generic tap via

XCUIApplication(bundleIdentifier: "com.apple.springboard").otherElements["Notification"].firstMatch.tap()

this is the error I get

*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil (NSInvalidArgumentException)

actually the push notification is visible and can be queried in the debug console. just tapping it, crashes the test.

I`m testing this with a real device (iPhone X, iOS 15).

Testing on a iOS 14 device still works.

Did anyone else face this problem or solve it?

Thanks you

  • I am facing the same issue, I am on iOS 15.4.1 version and Xcode 13.3.1.

    I get the same error `*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil (NSInvalidArgumentException)

    I am stuck and i am not able to handle the alert

  • Updated to 15.5, and it worked

Add a Comment

Accepted Reply

Ok, looks like updating to iOS 15.0.2 fixed this issue.

Replies

Ok, looks like updating to iOS 15.0.2 fixed this issue.

This should be opened again. We still get this errors until reconnecting and rebooting physically devices.

Hello!

If you are still seeing errors in this area, please file a report on Feedback Assistant with an attached .xcresult file showcasing the failure.

https://feedbackassistant.apple.com/

.xcresult files can be obtained from Xcode by right-clicking a test result and clicking "Show in Finder"