How to assign unique accessibility identifiers to the urls in UITextView or attributed text in UILabel?

How can we assign the unique accessibility identifiers to the urls in UITextView In the accessibility inspector, I am able to see the urls as separate elements but not able to set the accessibility identifiers for them. The accessibility identifiers are needed for automation testing.

In the screenshots added here, i have taken a UITextView which has urls in it.

You can use User Defined Runtime Attributes as detailed here:

https://medium.com/the-ministry-of-testing/adding-accessibility-identifiers-to-an-ios-app-c8e09d9c20f3

This isn't possible with the current API, if you find yourself needing to do this, please file a feedback report with a justification for your use case.

Did you get the solution for this issue?

How to assign unique accessibility identifiers to the urls in UITextView or attributed text in UILabel?
 
 
Q