appium/appium-inspector

iOS Elements Not Recognized in Appium Inspector Despite Accessibility Adjustments in React Native Project

Closed this issue · 9 comments

Is this an issue specifically with Appium Inspector?

  • I have verified that my issue does not occur with Appium, and should be investigated as an Appium Inspector issue

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I'm currently working on a React Native project and using Appium Inspector for iOS and Android automation testing. I'm encountering an issue where my iOS screen elements are not accessible individually in Appium Inspector, appearing instead as a single rendered screen element. In contrast, on Android, all the IDs provided through testID are recognized and displayed correctly.

Here's a summary of the steps I've taken and the findings so far:

Platform Differences:

On Android, all the testID values set in the code are appearing as expected in Appium Inspector.
On iOS, however, Appium Inspector is not detecting these IDs individually; instead, it displays the entire screen as a single element.
Troubleshooting Steps:

After reading through the documentation, I discovered that iOS can sometimes have layering issues, where multiple containers may cause Appium to view the screen as a single layer.
To address this, I began setting accessible=false on unnecessary container elements to reduce the layering.
This adjustment allowed me to view all testID elements correctly in Xcode's native inspector (Xcode Accessibility Inspector), where all IDs appear individually as expected.
However, despite these changes, Appium Inspector continues to render the entire iOS screen as a single element.
Configuration Attempts:

I tried several configuration tweaks within Appium Inspector, but they didn’t resolve the issue. The problem persists with Appium failing to recognize the testID elements, which are clearly available and correctly rendered in Xcode's Accessibility Inspector.

Expected Behavior

Appium Inspector should render the screen with all testID elements accessible individually, similar to what is seen in Xcode's Accessibility Inspector.

Operating System

Mac

Appium Inspector Version

2024.6.1

Appium Version

2.11.2

Further Information

No response

Some of appium/appium#14825 would help. Appium XCUITest depends on XCTest by Apple.

This adjustment allowed me to view all testID elements correctly in Xcode's native inspector (Xcode Accessibility Inspector), where all IDs appear individually as expected. However, despite these changes, Appium Inspector continues to render the entire iOS screen as a single element.

Could indicate they are available via Xcode's native one but not via XCTest framework by some reasons. The issue has some possible suggestions such as accessible={false} (already you did) or snapshotMaxDepth etc.

e.g. from Developer Tools Engineer https://developer.apple.com/forums/thread/749918?answerId=800794022#800794022

The 60 depth maximum was added to prevent apps from slowing down system performance when UI queries occur during an XCTest UI test. Unfortunately React Native often creates nested hierarchies that are larger than 60 levels of depth on iOS.

In addition to what Kazu mentioned:

@KazuCocoa I tried with increasing maximum depth and remove all unnecessary containers using accessible={false}.
but still no luck. we are using latest appium-inspector. Is there any other way ? my concern is its not accessibility issue as its working with Xcode inspector but maybe a configuration issue.

@GohilMahendra after upgrading to the latest Inspector, did you see the additional infobox for an element at max depth? That would confirm the reason for the issue.
Have you also checked the other suggestions in the Inspector documentation, as mentioned in my previous comment?

Closing due to no response

@eglitise can you please reopen

@GohilMahendra I am more than happy to reopen this once you provide the information I requested above.

@eglitise hi, checked this with team we are not able to see additional infobox .

@GohilMahendra that is somewhat unusual, assuming you are using version 2024.8.2 or later, and have selected the last element in the tree. Could you please provide a screenshot of the entire Inspector window to confirm this?