Search code examples
seleniumappiumui-automationappium-ios

Appium iOS can't inspect notification layer


Im using Appium to test my notifications in my iOS app. Im sending with another device a notification while the iOS app is in BG. Then I swipe down using :

        ((IOSDriver) wd).swipe(500,0,500,1000,1000);

The above works, the screen get scrolled down and I can physically see the notification. The issue is that the appium still inspects the screen below. I checked appium inspector and it verified that it doesn't recognize nothing but the elemnts of the layer below the notifications one.

Any approach ??


Solution

  • I found a workaround that fits my needs.

    I found out that if I click the home button and then swipe down the notification are visible to Appium. Because Appium not having key events for iOS, iPhone has the an accessibility option for home button, I toggled that on and I can simply click it during the test and swipe down the notification center.

    I know it's not ideal but its working. Thanks for the help.