-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Internal: b/126447958
Hi,
We'd like to test our Flutter-App with Appium. To unambiguously identify the elements (text fields, buttons, ...) it is necessary to provide a "technical" identifier. Searching by name (element's label) is not a stable approach (one problem e.g. ist that the same name could be used by different elements on the view).
Appium offers the selector strategies listed here: http://appium.io/docs/en/commands/element/find-elements.
A stable strategy would be when we could assign an accessibility id to elements (for Android this would be the "content-desc"). Another approach would be to use the native element identifiers (resource-id for android, name for iOS). These can both not be set on the flutter elements.
We found out that when a Semantic Object is created for an element that its label is taken as the accessiblity identifier. But this brings two problems: First, the label is, in our understanding, not the same as the id and it should be possible to treat them differently. Second, the object tree has the semantic node next (as sibling) to the element and this leads to the situation that the actual element to test cannot be identified because there could be further elements.
This situation makes it very hard to test the app with Appium (we think the same problems occur with other testing frameworks).
Do we miss something here?
When not: Is there a workaround?
Thanks for your answer.
Best regards,
Florian