Appium+python元素属性的获取

获取元素属性
1)获取text
.text
2)获取class属性
.tag_name
3)content-desc属性
.get_attribute("name")
#content-desc为空,取得text值
#content-desc不为空,取得content-desc 值
content-desc属性也可以这样获取:get_attribute("contentDescription")
4)id、class、text属性获取
.get_attribute("resourceId")
.get_attribute("className")
.get_attribute("text")
5)其他属性获取


.get_attribute("checkable")

6)size 和location
.size 返回大小
.location 返回坐标

原文地址:https://www.cnblogs.com/LinxiHuang/p/9286587.html