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));')


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM