robotframework,移动端(小程序)自动化,获取元素属性值的方法

如下图,获取商品价格

 

 

 

属性值显示在content-desc

 

 

 

传统的get text指定是无法获得到这个元素指定属性的值的

只有通过使用AppiumLibrary.get element attribute指令来获得,写法如下

 

${a} AppiumLibrary.get element attribute xpath=//android.view.View/android.view.View[13]    name

log ${a}

 

 

 

 

注意content-desc部分得写成name,否则依然获取不到值

posted @ 2019-09-20 09:28  小贝书屋  阅读(889)  评论(0编辑  收藏  举报