How to specify identifiers for HTML elements for hybrid app?

I'm currently developing hybrid MacOS app that display some content in WebKit. I wanted to write some UI tests using Appium for it. For this I'm currently using Mac2 driver https://github.com/appium/appium-mac2-driver

The problem that I faced is specifying identifiers for HTML elements to easily find them later in tests.

It seems Appium uses Accessibility framework to get list of elements. Also it seems that accessibility framework parses HTML and wrap them to XCUIElements in XML Source (I can see this in Appium inspector, check the screenshot)

As you can see Appium tries to get accessibility identifier/label from these elements.

While searching in web I found, that if we specify aria-label="something" property on HTML element, it will be parsed by accessibility framework as label. So we can use labels for locating elements. However in ideal scenario we should have some HTML property that will be parsed to identifier, as accessibility label is used for accessibility needs, while identifier is allocated for UI testing.

So my question is there HTML tag that can be used to specify identifier, and if not, is there plans to add support for it?

How to specify identifiers for HTML elements for hybrid app?
 
 
Q