Skip to content

Settings

The Mac2 driver exposes various settings through Appium's Settings API.

boundElementsByIndex

Type Default
boolean false

Whether to look up elements using allElementsBoundByIndex, as opposed to the default approach using allElementsBoundByAccessibilityElement. This Stack Overflow topic explains the difference.

This setting may help as a workaround for stale element reference errors containing Identity Binding text in their descriptions.

fetchFullText

Type Default
boolean false

Whether to fetch the full element text payload, as opposed to the default approach of fetching only the first 512 characters.

The default approach is based on XCTest's standard snapshotting mechanism, which is known to cut off long payloads for performance reasons. Enabling this setting switches to a custom snapshotting mechanism, which is slower, but retrieves the full payload. The value can then be obtained using APIs like Get Element Attribute or Get Element Text.

Available since driver version 3.2.0.

useDefaultUiInterruptionsHandling

Type Default
boolean true

Whether to use the standard XCTest UI interruption handler, as opposed to disabling it for the Application Under Test.

Turning this off may be useful for scenarios that interact with the interrupting element itself, instead of having its view be implicitly closed. Refer to this WWDC presentation to learn more about handling UI interruptions.

useDomIdAsAccessibilityId

Type Default
boolean false

Whether to expose a WKWebView web element's DOM id as its accessibility identifier, so that web content can be located by accessibility id the same way as on other platforms.

Web content rendered by WebKit does not populate the standard accessibility identifier (AXIdentifier) that the accessibility id locator matches. Instead it publishes the element's HTML id through the non-standard AXDOMIdentifier attribute. With this setting enabled the driver reads AXDOMIdentifier and uses it as a fallback for accessibility id lookups, for the identifier attribute and for the page source. The fallback only applies to elements whose native identifier is empty, so locating native elements is never affected.

Native XCTest predicate/class chain matching cannot reliably observe this fallback for the standard identifier attribute. To locate web elements by DOM id from predicate string or class chain locators, use the amIdentifier attribute instead - it has the exact same value and the exact same setting-gated fallback behavior as identifier, but can be reliably matched from these locators too, at any position in a class chain.

Notes:

  • Enabling this makes accessibility id lookups that find no native match inspect the application's web nodes, which costs an extra snapshot walk. That is why it is off by default.
  • WebKit builds a web view's accessibility subtree lazily, so the very first lookup after a page appears may need a retry, or a page source request, before the web content is present.