0
votes

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 ??

2
have you checked "adb shell dumpsys window windows" ? - pankaj mishra
@pankajmishra can you elaborate please ? - Nativ Barak
The above command gives all the details about current screen on focus, so u will get the details about notification - pankaj mishra
Sounds awesome ! how do I run it inside a java code ? - Nativ Barak
First check out manually by running this command on command prompt and see if u r getting the result or not - pankaj mishra

2 Answers

0
votes

As long as I know it is known limitation for iOS now.

You can get notification bar elements on Android only

But based on top comment it should be possible to wrap up with Appium since Xcode 9 introduced interaction with multiple apps, so its matter of time.

0
votes

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.