当报错'list' object has no attribute 'click'的解决办法,如图;appium 获取元素的内容 获取元素的位置和大小;

 

 

#获取设置栏所有标题的文本内容
eles = driver.find_elements_by_id("com.android.settings:id/title")
for i in eles:
print(i.text)

 

#获取放大镜的位置
search_button = driver.find_element_by_id("com.android.settings:id/search")
print("---位置:")
print(search_button.location)
print("---坐标:")
print(search_button.size)

 

 

 

---位置:
{'x': 1248, 'y': 112}-----------------------------黄色部分
---坐标:
{'height': 192, 'width': 192}------------------绿色部分

posted @ 2020-07-30 15:33  胖豆芽  阅读(1860)  评论(0编辑  收藏  举报