uiautomator实现滚动查找元素方法

使用一下方法滚动查找当前页文本

‘new UiScrollable(new

UiSelector().scrollable(true).instance(0)).scrollIntoView(new

UiSelector().text("查找的元素文本").instance(0));’

 

 

例:

def find_by_scroll(self):
return self.driver.find_element(MobileBy.ANDROID_UIAUTOMATOR,
'new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector()f.text("想要查到的文本").instance(0));')
posted on 2020-07-29 11:31  进击的麻瓜  阅读(1585)  评论(0编辑  收藏  举报