Difference between delay and pushTimeout(), popTimeout() in UIAutomation iOS

大兔子大兔子 提交于 2019-12-12 00:37:12

问题


What is the difference between

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

and

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

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.


回答1:


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.



来源:https://stackoverflow.com/questions/17835368/difference-between-delay-and-pushtimeout-poptimeout-in-uiautomation-ios

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