Env:
Appium server 1.3.1
Java/java client 2.0.0
Real device Nexus 5 - 4.4.4
Mac 10.9
For my tests using Android I always use the uiautomatorviewer to inspect the elements and verify the resource-id, to identify the xpath, or ways to find a reliable locator.
The component I’m trying to find is a Button with a proper resource-id, and text.
I tried to use the resource-id, but it fails most of the time
Then I tried to use a list of Elements using ByChained(className(“android.widget.LinearLayout”), className(“android.widget.Button”)), and checking the Text inside, but it keeps failing most of the times that I tried to run.
I also tried to use an xpath(“.//android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.Button”), but usually it finds 2 elements, which are not the target one.
As soon as I download dmg of the latest version, I tried to use the inspector from Appium, but I couldn’t find the component.
I started debug my test, and I kept entering the screen and run the findElements command, and sometimes it finds, and most of the times it doesn’t. When it finds the element, it can use any of the previous locator that I mentioned.
Usually I use a waitDriver to find the element, but all the cases it keeps trying to find the element without success until the TimeoutException occurs.
Shouldn’t be able to see the same elements that uiautomatorviewer can see? Any other advice?
I attached the uiautomatorviewer screenshot