Appium iOS无法检查通知层 [英] Appium iOS can't inspect notification layer

查看:100
本文介绍了Appium iOS无法检查通知层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Appium在我的iOS应用中测试我的通知. 我在iOS应用处于BG模式时通过另一台设备发送通知.然后我使用:

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);

以上操作有效,屏幕向下滚动,我可以实际看到通知.问题是,appium仍在检查下面的屏幕. 我检查了Appium Inspector,它验证了该消息除了通知层下面的元素之外什么都不识别.

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.

任何方法??

推荐答案

我找到了适合我需要的解决方法.

I found a workaround that fits my needs.

我发现,如果我单击主页按钮,然后向下滑动通知,则Appium可以看到该通知. 由于Appium没有适用于iOS的关键事件,因此iPhone具有主页按钮的可访问性选项,因此我将其切换为打开状态,只需在测试过程中单击它,然后向下滑动通知中心即可.

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.

这篇关于Appium iOS无法检查通知层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆