openatx / uiautomator2

Android Uiautomator2 Python Wrapper
MIT License
6.38k stars 1.37k forks source link

期望恢复功能 x, y = d(text="Settings").center(offset=(0, 0)) # left-top x, y #1017

Open TonyGao2527 opened 1 month ago

TonyGao2527 commented 1 month ago

uiautomator2==3.2.0 有时候不是想获取元素中心位置,而是某个位置 如下方日历,当日背景是蓝色,这个蓝色区域是固定的, 但是随着日期变化,中心位置不一定是蓝色, 所以相获取(0.5, 0.25) 这个位置 进行断言, 它一定是固定的。 目前使用 .center(offset=(0, 0))会报错如下信息: TypeError: XMLElement.center() got an unexpected keyword argument 'offset' QQ20240726-112029 QQ20240726-153150