iOS8.0 Notification Allow 弹出框解决办法

话说,我们的应用升级了,xcode也升级了,开发把所有都升级了。。结果就是我的老版本的模拟器对有些输入框无法输入了。。。

各种搜。。。Appium bug? (https://github.com/appium/appium/issues/4286) 要1.3.6 解决,现在才1.3.5,查看版本历史,基本要1个月以后了。。。老大说了,年前要解决这个问题。。。

好吧,换iOS8.0 试试,不错,可以输入了,哇哈哈,全换iOS8.0,就此正题开始了。。。

应用启动后就弹出了 *** Would like to Send You Notifications …….

尝试1:识别alert,写代码点掉他

抓取是没有问题的,,XPath,name。。。都可以,结果就是执行的时候找不到,不到,不到到。。。原来这个是系统的,无法操作

尝试2:capabilities 设置 autoAcceptAlerts

capabilities 设置连接 https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md

autoAcceptAlerts Accept iOS privacy access permission alerts (e.g., location, contacts, photos) automatically if they pop up. Default is false.

看起来不错,添加,执行,哇哈哈,果然KO了它, 各种执行,太完美了,,, 就在此时,没错,刚KO的alert,完全没有了,对没错,完全没有了,就连我自己app弹出来的alert也自动被KO了,太完美了,我都不用干活了,app自己alert的信息完全不给我验证的机会啊。。。

问题来了,怎么只点系统的alert,而漏掉app自己的链接,给我个验证的机会

尝试3: 设置autoAcceptAlerts, 等app开起来关掉 系统alert后,关闭autoAcceptAlerts

哇哈哈,太完美了,简直无法直视啊。。。开干,set, start,update,等等,好像没有update,这是一条路走到黑啊(别笑话我,内部了解不透彻。。)

路都死了?继续各种搜。。。冬天来了,春天也该来了,挖到宝了https://github.com/appium/appium/issues/4178内容大概就是,这个,那个,然后。。。(还是自己看吧,我E文太烂,就不解释了)

尝试4:capabilities 设置 waitForAppScript

waitForAppScript The ios automation script used to determined if the app has been launched, by default the system wait for the page source not to be empty. The result must be a boolean e.g. true;, target.elements().length > 0;, $.delay(5000); true;

设置waitForAppScript 为 $.delay(5000); $.acceptAlert(); true; 大概意思就是等待appOK的时候执行设置的js执行,系统alert被KO, 然后,然后,App的alert保留,太完美了,完美了,美了。

就这样吧,理解有错误的,往大神指点。

Max.Bai@20150212

人情似纸张张薄,世事如棋局局新。

iOS8.0 Notification Allow 弹出框解决办法

相关文章:

你感兴趣的文章:

标签云: