如何使用Appium和Java点击Android中文本旁边的元素?

时间:2018-03-21 07:50:43

标签: java android automation appium

我需要点击给定标题旁边的选项按钮。我已经使用了下面的xpath。

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

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

这是Appium会议。

enter image description here

谢谢。

1 个答案:

答案 0 :(得分:1)

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

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