Hi, I’m brand new to Appium but one thing that has confused me is the use of accessibility ids for finding elements, I thought the purpose of these was to provide partial sighted users with content descriptions for text to speech, they should therefore be localised and thus useless for identifying elements. I guess that the majority of developers probably don’t put these in. ( I didn’t even realise they existed until now) so its not a big deal, but maybe the documentation should state that really this is a bit of a misuse of a OS feature and you cannot use them for identification and making a more accessible app at the same time. If a user has text to speech enabled will they not get these labels read out to them? Or am I completely missing something.
I would argue that the two use-cases (visually impaired users and Appium element locators) don’t have to contradict each other. You can have content descriptions that help the visually impaired and also be used by Appium to locate elements.
The way I think of it is that Appium is a black-box, automated UI testing tool that is meant to simulate a person using your app. So it kind of makes sense that Appium would locate elements the same way a visually impaired person locates elements.
You are correct though that you it’s bad practice to be adding unneeded content descriptions that are used solely for element location. This issue echoes your concerns: https://github.com/appium/appium/issues/6025
Maybe we all need to start thinking of Appium as a visually impaired user. Then the use case of “content‑description” can still have a single purpose. That said, iOS definitely has both accessiblityIdentifieras well asaccessibilityLabel. The Label is for screen readers, the Identifier is for Appium.