Could not find element using xpath with Appium (robot infrastructure)

I cannot identify an element using xpath. I tried different types of xpath but could not identify it.

I want to identify the “Accounts” item shown in the image below. I have no ID, so I use xpath. I used below xpaths.

xpath = // android.app.ActionBar $ Tab / TextView [@text = 'Bills'] and xpath = // android.app.ActionBar $ Tab 1 / TextView [@ text = 'Bills']

Please help me. I am amazed here.

enter image description here

+4
source share
4 answers

"" xpath:

xpath=//android.widget.TextView[@text='Bills']

, , ( ), xpath .

+1

- , , xpath :

xpath=//TextView[@text='Bills']
0

:

= XPath (//android.widget.TextView [@ = '']) [1]

, UI Automator Viewer

. 1.

0

xpath .. , , :

Xpath=//android.widget.linerlayout[1]/android.widget.linerlayout[1]/android.widget.TextView[@text='Bills']
-1

All Articles