【问题标题】:Unable to create an appium-android xpath using following-sibling and child无法使用 follow-sibling 和 child 创建 appium-android xpath
【发布时间】:2021-03-02 12:35:52
【问题描述】:

我想在//android.widget.TextView[@text='Active'] xapth 的帮助下为 UNLIMITED DATA 创建一个 xpath。

我尝试使用以下 XPath 使用 following-siblingchild 定位元素,但没有成功。

//android.widget.TextView[@text='Active']/following-sibling::androidx.recyclerview.widget.RecyclerView/child::androidx.cardview.widget.CardView/child::android.widget.TextView[contains(@text,'UNLIMITED Data')]

请找到下面的图片供您参考。 enter image description here enter image description here

请帮忙。

【问题讨论】:

    标签: selenium automation appium ui-automation appium-android


    【解决方案1】:

    你能试试这个 XPath 吗:

    //android.widget.TextView[@text='Active']/following-sibling::androidx.recyclerview.widget.RecyclerView[1]//android.widget.TextView[contains(@text,'UNLIMITED Data')]
    

    【讨论】:

      猜你喜欢
      • 2018-02-02
      • 1970-01-01
      • 1970-01-01
      • 2015-12-21
      • 2018-03-15
      • 2018-06-15
      • 2017-05-04
      • 1970-01-01
      相关资源
      最近更新 更多