安卓自动化测试——rf

     ${a}                                        Get Text                                    //android.widget.TextView[contains(@text,"历史位置")]/../../../android.widget.LinearLayout[@index="1"]/android.widget.LinearLayout[@index="1"]/android.widget.TextView

会报错,参数不是有效的。

所以在安卓中,一般使用

    ${mytext}=                           Get Element Attribute            ${a}             text

这样就不会报错了

    Element Should Contain Text                ${Text}                         稿件库

这个方式也可以。

Click Text                                  ${LOCATION}                     exact_match=True
点击文本时,如果完全匹配的文本,将exact_match设置为True。
原文地址:https://www.cnblogs.com/feifei-cyj/p/7930475.html