XCUITest is not able to detect element nested view hierarchy post 62 depth.

Hi, We are writing our automation tests on app based which is hybrid of Native and React Native. We are using Appium 1.22.3 and on some screens it is not able detect element s and giving us stale Error. On deep diving, we debugged and created a project with dummy views, wrote XCUITest and found out that after number of children (in view hierarchy is greater than 62), it is not able to detect the elements. It truncates the snapshot of generated tree hierarchy. It seems like a limitation from XCUITest, irrespective of native or React Native. What is a resolution to fix this and How can we unblock our automation on this massive problem?

Thanks

UI tests use the Accessibility hierarchy to determine what elements are on screen at any given time. It's possible that React Native does not report more than 62 items to the Accessibility hierarchy at any given moment.

If this is a limitation on their end, then one possible workaround would be to scroll down a page in small segments to see if more elements get loaded in as scrolling happens. Maybe React Native would load elements into Accessibility at that point?

Hi @yashawasthimbai, have you found a solution for this issue? Thanks

XCUITest is not able to detect element nested view hierarchy post 62 depth.
 
 
Q