簡體   English   中英

如何使用Appium和Java在Android中點擊文本旁邊的元素?

[英]How to tap the element next to a text in Android using Appium and Java?

我需要點擊給定標題旁邊的選項按鈕。 我已經使用了下面的xpath。

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

但這是行不通的。 請幫我解決這個問題。

這是Appium會話。

在此處輸入圖片說明

謝謝。

我已經找到解決此問題的方法。 正確的xpath應該是

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM