【问题标题】:How to tap the element next to a text in Android using Appium and Java?如何使用 Appium 和 Java 在 Android 中点击文本旁边的元素?
【发布时间】:2018-03-23 17:46:06
【问题描述】:

我需要点击给定标题旁边的选项按钮。我为此使用了以下xpath。

//*[@text='Copy Source Deck']/following::android.widget.ImageButton[@content-desc='deck options']

但它不起作用。请帮我解决这个问题。

这是 Appium 会话。

谢谢。

【问题讨论】:

  • 期待专家对此提出建议

标签: java android automation appium


【解决方案1】:

我已经找到了解决这个问题的方法。正确的 xpath 应该是,

//android.widget.TextView[@text='deckName']/preceding-sibling::android.widget.ImageButton

【讨论】:

    猜你喜欢
    • 2015-10-17
    • 2021-04-04
    • 2019-03-10
    • 2015-12-07
    • 2018-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多