Python 无法从xml页获取元素列表
我需要找到列表中的某个条目是否被选中并取消选中。 我正在使用uiautomator来执行此操作。我正在以这种方式在列表上循环:Python 无法从xml页获取元素列表,python,automation,android-uiautomator,Python,Automation,Android Uiautomator,我需要找到列表中的某个条目是否被选中并取消选中。 我正在使用uiautomator来执行此操作。我正在以这种方式在列表上循环: for box in device_obj(className="android.widget.LinearLayout"): .. 问题是有几个其他对象具有相同的类名。 所以我给出了从列表成员开始的路径: for box in device_obj(className="android.widget.ListView").child( classNa
for box in device_obj(className="android.widget.LinearLayout"):
..
问题是有几个其他对象具有相同的类名。
所以我给出了从列表成员开始的路径:
for box in device_obj(className="android.widget.ListView").child(
className="android.widget.LinearLayout"):
..
令我惊讶的是,我只得到了第一个名单成员-“显示提示”!
为什么会这样?
当路径由2个或更多元素组成时,我不能获取元素列表吗
这是屏幕和xml屏幕截图:
尝试使用
element = find_elements(:xpath, //android.widget.LinearLayout/android.widget.ListView).map