appium / appium-mac2-driver

Next-gen Appium macOS driver, backed by Apple XCTest
Apache License 2.0
116 stars 24 forks source link

Mac2 Driver - Not Able to See Accessibility Id in pageSource When Dealing with SwiftUI Elements on Mac Desktop Application #146

Closed jeff-eg closed 2 years ago

jeff-eg commented 2 years ago

Hello,

Currently when we add accessibility id’s in swift ui elements for our mac desktop application I am not seeing the id’s in the driver.PageSource. Is anyone else seeing this problem?

Here is a discussion of things in the appium forums... https://discuss.appium.io/t/mac2-driver-not-able-to-see-accessibility-id-with-swiftui-elements-on-mac-desktop-application/36702

I can however see the accessibility ids in the xcode accessibility inspector.

This seems to be a bug with mac2 driver and swift ui elements

mykola-mokhnach commented 2 years ago

I don't think there is much we could do there. WDA uses the official XCTest API https://developer.apple.com/documentation/xctest/xcuielementsnapshotproviding/3022452-snapshot to fetch the tree. Perhaps, elements you are looking for, are just attached to another accessibility root rather than the current app root. Then you could try to switch to another app as a possible solution. Otherwise I don't have any good ideas so far.

jeff-eg commented 2 years ago

Ok. I'll continue to figure things out. Thank you!