Why are some Native App elements not detected correctly?


I’ve recently started to Automate some of my testcases for a NATIVE app (React) and I’m seeing malfunctions when attempting to interact with a few of the elements in the app. Just wondering why this is happening and if this is common.

For example - the following buttons appear for a “Contact” if I swipe to the left on it:

But when I try to detect whether those buttons are visible - it turns out that they’re considered visible even if they’re not:

Notice that the invisible ‘Delete’ TextView has the same exact Attributes as the visible one. Making it impossible to tell if when Delete button appeared. Same problem exists for the the parent android.view.ViewGroup. Fortunately I was saved in that case by the fact that the icon in front of the Contact does actually cease to exist when Contact is dragged to the left like that.

But why is this element structure not detected correctly?

Another example of a problem:

When Creating a Contact - there’s a dropdown for selecting a Contact type. Yet when I expand it - the UI element for the expanded dropdown does not appear - thereby making it impossible to tell if it has been expanded - or what choices are available for selection. Well - actually that’s not true - some sort of 3 pixel tall ViewGroup does appear - but I have no idea what it signifies. So at least I’m able to tell when the dropdown has been expanded - but I’m forced to try to dynamically calculate the coordinates for the different possible choices in order to select the correct type.



Lastly - the entire damned thing seems to be extremely unstable. Like I see following errors all the time:

[WD Proxy] Proxying [GET /wd/hub/session/70ede4c9-c277-4d9a-916d-ddd84be1a4f4/source] to [GET] with no body
[WD Proxy] socket hang up
[W3C (70ede4c9)] Encountered internal error running command: Error: Could not proxy. Proxy error: Could not proxy command to the remote server. Original error: socket hang up
[W3C (70ede4c9)] at doJwpProxy (C:\Users\ssarnavskiy\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:481:13)
[W3C (70ede4c9)] at asyncHandler (C:\Users\ssarnavskiy\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:253:9)
[HTTP] <-- GET /wd/hub/session/70ede4c9-c277-4d9a-916d-ddd84be1a4f4/source 500 225 ms - 861
[Instrumentation] INSTRUMENTATION_ABORTED: System has crashed.

So… is this stuff really raw? Or is there something in my setup that makes it so unstable? Why is it having trouble with some UI elements?