openatx / uiautomator2

Android Uiautomator2 Python Wrapper
MIT License
6.48k stars 1.38k forks source link

希望能同时判断多个组件中任一一个是否存在 #965

Closed Creat55 closed 4 months ago

Creat55 commented 5 months ago

希望实现的功能是同时检查多个组件中是否至少存在一个,这个检查过程需要支持传入一个list以提高效率。具体来说,就是想要一个方法能够像 .exists 或 .wait() 那样,不仅能判断单个组件的存在性,还能并发地判断多个组件中任何一个的是否存在。

codeskyblue commented 4 months ago

3.1后面的版本开始支持。

可以这样写

sel = d.xpath("App") | d.xpath("NFC")
print(sel.exists)
sel.click()