UIAutomation iOS中的delay和pushTimeout(),popTimeout()之间的区别 [英] Difference between delay and pushTimeout(), popTimeout() in UIAutomation iOS

查看:92
本文介绍了UIAutomation iOS中的delay和pushTimeout(),popTimeout()之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

app.delay(20);
tableViewCell.waitForInvalid();

app.pushTimeout(20);
tableViewCell.waitForInvalid();
UIATarget.localTarget().popTimeout();

在第二种情况下,如果单元格在2秒内失效,那么它将仍然等待持续18秒,然后继续还是2秒后继续?在第一种情况下,它要等到20秒。

In the second case, in case if the cell becomes invalid in say 2secs, then will it still wait for 18secs and then continue or just continue after 2secs ? In the first case, it is waiting until 20secs.

推荐答案

不,第二种情况是首选,因为它将等待最多20秒使该单元格失效。在第一种情况下,脚本将延迟20秒。当等待元素在屏幕上更改时,按下新的超时将更改系统范围的超时。在脚本需要更改时进行推送和弹出是一种非常有效的方法,用于管理您可能需要等待脚本验证所需行为的不同时间。

No, the second case is preferred because it will wait up to 20 seconds for the cell to become invalid. The first case, the script will delay for 20 seconds regardless. Pushing a new timeout changes the system wide timeout when waiting for elements to change on the screen. Pushing and popping as your scripts needs change is a very effective way to manage the different amounts of time you might need to wait for the script to verify the behavior you want.

这篇关于UIAutomation iOS中的delay和pushTimeout(),popTimeout()之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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