Appium iOS can't inspect notification layer

↘锁芯ラ 提交于 2019-12-13 04:19:54

问题


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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/48006973/appium-ios-cant-inspect-notification-layer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!