|
马上注册,结交朋友,共同学习EasyClick
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本人现在碰到一个App,很奇葩.一个可以上下滚动页面的界面里,无论是滚到页面的底部还是页面的最上面或者页面的中间都能获取到节点信息
在页面最上面的时候获取到的信息
let node = text("今日签到").getOneNodeInfo(1000)
if (node) {
logw("有");
} else {
logw("没有");
}
logw(JSON.stringify(text("今日签到").getOneNodeInfo(1000)))
logw(text("今日签到").getNodeInfo(1000))[2022-11-04 01:26:25.636]【远程设备】(js/main.js#55 )有[2022-11-04 01:26:25.876]【远程设备】(js/main.js#59 ){"bounds":{"top":1519,"bottom":1520,"left":114,"right":232},"visibleBounds":{"top":1519,"bottom":1520,"left":114,"right":232},"childCount":0,"clz":"android.view.View","pkg":"com.taobao.live","text":"今日签到","checkable":false,"checked":false,"clickable":false,"enabled":true,"focusable":false,"focused":false,"longClickable":false,"scrollable":false,"selected":false,"nid":"android.view.accessibility.AccessibilityNodeInfo@60abd","parentId":"android.view.accessibility.AccessibilityNodeInfo@6088f","index":1,"depth":26,"visible":true,"drawingOrder":0,"editable":false,"password":false,"multiLine":false,"dismissable":false}[2022-11-04 01:26:26.110]【远程设备】(js/main.js#60 )[object Object]
很奇葩,visble属性永远都是true
因为想写成适配各种不同分辨率手机的,所以冒出来一个想法,
能否固定一个范围,在一个手机屏幕上固定的范围内搜索想要的节点信息
下面是页面里最下面的获取信息,本人手机是720*1520分辨率,这个页面在我手机上差不多一比一的上下滚动要滚两次半才到底部
let node = text("今日签到").getOneNodeInfo(1000)
[2022-11-04 01:28:18.334]【远程设备】(js/main.js#55 )有[2022-11-04 01:28:18.803]【远程设备】(js/main.js#59 ){"bounds":{"top":55,"bottom":57,"left":114,"right":232},"visibleBounds":{"top":55,"bottom":57,"left":114,"right":232},"childCount":0,"clz":"android.view.View","pkg":"com.taobao.live","text":"今日签到","checkable":false,"checked":false,"clickable":false,"enabled":true,"focusable":false,"focused":false,"longClickable":false,"scrollable":false,"selected":false,"nid":"android.view.accessibility.AccessibilityNodeInfo@60abd","parentId":"android.view.accessibility.AccessibilityNodeInfo@6088f","index":1,"depth":26,"visible":true,"drawingOrder":0,"editable":false,"password":false,"multiLine":false,"dismissable":false}[2022-11-04 01:28:19.07]【远程设备】(js/main.js#60 )[object Object]
如果说用的是下面这种找到就直接点击 根本就点不到 今日签到,点了也会有logd(true),但是问题点的不是今日签到啊!
let node = text("今日签到").getOneNodeInfo(1000)
if (node) {
logw("有");
node.click()
} else {
logw("没有");
}
|
|