[心缘地方]同学录
首页 | 功能说明 | 站长通知 | 最近更新 | 编码查看转换 | 代码下载 | 常见问题及讨论 | 《深入解析ASP核心技术》 | 王小鸭自动发工资条VBA版
登录系统:用户名: 密码: 如果要讨论问题,请先注册。

[备忘]UIAutomator2一直不点按钮,Could not detect idle state

上一篇:[转帖]nubia努比亚手机,如何保持后台运行
下一篇:[备忘]springboot集成druid,mybatis,通用mytatis,多数据源

添加日期:2020/5/27 11:46:35 快速返回   返回列表 阅读2382次
页面有个跑马灯,文字一直在动,
UIAutomator2一直不点按钮,超慢,
看logcat有如下信息:
Could not detect idle state
……
大概跟waitForIdleTimeout有关。
一顿乱调,貌似好使了。


Configurator conf = Configurator.getInstance();
conf.setActionAcknowledgmentTimeout(1000L); // Generally, this timeout should not be modified, default 3000
conf.setScrollAcknowledgmentTimeout(100L); // Generally, this timeout should not be modified, default 200
conf.setWaitForIdleTimeout(100L); //default 10000
conf.setWaitForSelectorTimeout(100L); //default 10000



(1)WaitForIdle,就是等待页面空闲,两个event间隔500毫秒的话,中间就算空闲了。
一直等10秒(默认值),还不闲就拉倒吧?
(2)先WaitForIdle,如果空闲了,再查找控件,也就是WaitForSelector,
要么找到控件,要么超时,也就是WaitForSelectorTimeout,默认是10秒。
(3)我把WaitForIdleTimeout改成100毫秒后,那么爱咋闪咋闪,等100毫秒就可以找控件。
控件最多找100毫秒,没有拉倒。
(4)ScrollAcknowledgmentTimeout,这个是滚动后,等待框架确认结果的时间
(5)ActionAcknowledgmentTimeout,这个是点击等动作后,等待框架确认结果的时间?
 

评论 COMMENTS
没有评论 No Comments.

添加评论 Add new comment.
昵称 Name:
评论内容 Comment:
验证码(不区分大小写)
Validation Code:
(not case sensitive)
看不清?点这里换一张!(Change it here!)
 
评论由管理员查看后才能显示。the comment will be showed after it is checked by admin.
CopyRight © 心缘地方 2005-2999. All Rights Reserved