(Automation: Appium\Java) (Xamarin Forms\iOS 13) Elements not visible in tree, after in-app downloads

Summary: We have a Xaamrin Forms iOS\Android application. My goal is to make auto-tests for iOS-app built with Xamarin.IOS 12.10 and Xcode 10.2.1. Builds are made by App Center. Target iOS versions are: 12 and 13. Testing must be performed on real devices, so I not bothered with simulators.

Problem: on devices with iOS 13 element tree contains all elements correctly, i.e. Appium can see all elements and interact with them. But, after “synchronisation” (Which is in-app download of database from server. It’s necessary for application to work) element tree reduces just for 2-3, each representing a whole screen. So tests cannot find particular elements and fail. Strangely, but on iOS 12 things go smooth all time whether app made download or not.

Appium versions used: 1.15.1 - on local machine, 1.11 in App Center (though I suppose they’ve forked it somehow, but it never explicitly said in documentation) Problem oсcured on both versions.

Questions: How elements can become inaccessible like so in general? What is most probable source of problem in this case particular: iOS, Appium, maybe app itself? Did someone encaunter this or a similar problem? Is there a working solution for it?

Here are links to page sources that I managed to get from tests. I got theese two from same device iPhone XR, iOS 13.3, Appium 1.15.1

Normal Element Tree: https://drive.google.com/open?id=1G82n1xYAxiMQ3q-VV22NXCarM_2dXws3

Element Tree After DB Download: https://drive.google.com/open?id=1nywD3ShSdb1lDbN77mGB6WW018RNjO4F

I’m having a similar issue. When I open the app the elements on the homepage are not rendered like the ones that you’ve shown, but if I open some other screen like login, then both login and homescreen elements are rendered and shown in the element tree.

Nothing is changed in Appium, but with new iOS version new issues appear. I would say it is clear what is causing these.

Regarding the accessibility: It depends on both how the app is designed and how Xamarin handles it. Make sure all components there are up to date (including Appium), the app follows Xamarin’s best practices for making it accessible and the standard Accessibility inspector can see its controls. In case it does not then consider contacting Xamarin devs and reporting it as an issue. Although, if the Accessibility inspector does reflect the controls properly, but still nothing is visible by Appium then this could be either XCTest issue (I would say 80% probability that it is) and there is still 20% it could be somehow tuned/workarounded on WebDriverAgent side. But please verify the above stuff first before we could move to these 20%.