Mac2 Driver - Not Able to See Accessibility Id with SwiftUI Elements on Mac Desktop Application

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?

Current Capabilities:
setCapability(“automationName”, “mac2”)
setCapability(“platformName”, “mac”)
setCapability(“appium:showServerLogs”, “true”)

Are these capabilities correct or should I use some other combination?

Jeff

Here is a tutorial on adding accessibility id’s in swift:

Note that it discusses using the Xcode Accessibility Inspector to test the id’s. If Xcode can’t see them, Appium won’t be able to either. You should test them with Xcode & if can’t see them report a bug to the developer citing the article.

I’ll take a look. Thank you for the reply!

I can see the elements in the xcode accessibility inspector but not in driver.PageSouce. Do I need to add a bundle id or something else in the configuration to see the desktop application elements?

This is all I am setting…
Current Capabilities:
setCapability(“automationName”, “mac2”)
setCapability(“platformName”, “mac”)
setCapability(“appium:showServerLogs”, “true”)

I don’t run the Mac2 driver, but this looks good to me. Do you have the Xcode Helper app installed & all that?

https://appium.io/docs/en/drivers/mac2/

Other info on interacting with elements here:

I’m taking it that the ‘identifier’ is blank? Also check ‘label’ and ‘title’ for id strings.

I have the accessibility helper and its all configured correctly. It seems I have the mac2 driver running correctly with the correct desired capabilities set as well. When I start my automation and instantiate the driver and then do a driver.PageSource I do not see my specific element at all in the pageSource. I do see the element in the xcode accessibility inspector though. Please seem screen shot below. Notice the identifier is eg-gear-menu. If the element shows up here but not in pageSource, this seems like a bug with the Appium mac2 driver dealing with swift ui elements on mac os.

Any other thoughts here? If I file a bug who do I file it against?

You can file a bug on the github I referenced above for appium/appium-mac2-driver. Go to the issues tab to see current bugs & use New issue to file a bug.

1 Like