S
S
Slayred2021-07-05 18:27:07
Android
Slayred, 2021-07-05 18:27:07

Why does UIAutomatorviewer determine the wrong index on the parent element?

Good day!
There is a native mobile application where I can find some elements only through xpath.
UiAutomatorViewer shows one index (in my case 2), but in fact it is searched for by another index (3, i.e. one more). At the same time, only one of the layouts has this behavior. If I take the parent layout of the desired element, then the index is correct, and if the parent is above the parent, then the index is 1 less. If you look through AppiumViewer, then the xpath value is "correct" there (that is, the element is located at these idneks) 60e324b18adfa648587392.jpeg
Below the tree is another switch, there is the same behavior as the selected one.
Is this some kind of standard behavior, or a feature of my application?
example of searching for the 'njuj element - "//android.widget.LinearLayout[3]/android.widget.LinearLayout[2]/android.widget.Switch"
on the screen, the desired element is "selected" and the parent over the parent
thanks in advance!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question