I am usually faced with a problem with UI Tests.
Not every screen is using accessibility (unfortunately) in my application and I still want to write the UI-Tests for those screens.
Problem is to access elements in UI Tests, accessibilityIdentifier/ accessibilityLabel is needed.
So Question — How can we access elements whose accessibility is OFF?
Any help will be appreciated.
As I shuffle through the cells of the list view in the Accessibility Inspector, VoiceOver uses the “dishLabel” value automatically to identify the whole cell.
Is that something you achieve by doing anything in the storyboard, or it just picks the first available label text value it finds in the cell’s contentView subviews hierarchy?
@k28gupta Thanks very much for your question, and my apologies for the delayed response.
From what I know, unfortunately your UI elements must have an accessibilityLabel and/or an accessibilityIdentifier, with the “isAccessibilityElement” property set to “true”.
I really am sorry. I hope this helps.
All the best.
[EDIT] I updated to Xcode 12 Beta 4 and the problem went away! I do not delete the comment and leave it here if somebody got the same issue.
I really want to get better at accessibility for my future apps. I started the tutorial and the first thing I get when compiling is “ERROR: Each TDDistiller instance can be distilled only one time!”.
Kinda of cryptic. Stackoverflow did not help much this time. I guess it might be unrelated to this tutorial but I never had this problem before.
If anyone had the same problem pls help. I already tried the usual things, like clearing the build and deleting the derived data folder… restarting Xcode etc.
I am on Xcode 12 Beta 2, Mac Big Sur but don’t think this has to do with the beta. We’ll see!
Thank you for the tutorial.
I have a question here. It looks like the ‘Invert Colors’ option doesn’t seem to run in the Accessibility Inspector in Xcode-12.4 Mac OS-Bug Sur. In that case how should we test the ‘Invert Colors’ option?