appium / appium-mac2-driver

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

elements lookup Xpath strategy #290

Closed MagdelineNg closed 3 months ago

MagdelineNg commented 3 months ago

What page source API is used by the Mac2 driver to generate the XML tree? For each MacOS app, is the XML generated from the existing HTML used to build the app? I am asking as I want to improve the XPath selectors used by my app (to be more specific, since certain elements lack unique attributes like title/value) but am not sure how the XML tree is currently being generated and found by Mac2 driver

mykola-mokhnach commented 3 months ago

https://github.com/appium/appium-mac2-driver/blob/master/WebDriverAgentMac/WebDriverAgentLib/Utilities/FBXPath.m has all the logic https://github.com/appium/appium-mac2-driver/tree/master?tab=readme-ov-file#element-location describes to what xctest attributes different locators are mapped