-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Picker control does not properly emit SemanticProperties.Description
as content-desc
on Android
#16282
Comments
Adding to this: |
Related bug #1186 - this one was reproduced bug closed. I cannot comment there anymore, but probably would be good to have that one reopened |
@hansmbakker You need to use AutomationId to locate elements We use an AccessibilityDelegate a few places in |
Hi @hansmbakker. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
|
@PureWeen I saw you added dotnet/docs-maui#1577 - this would be really welcome to have some insight in how to more effectively write UI tests! |
Description
The Semantic Properties are the recommended way in MAUI to add accessibility metadata.
On Android (have not tested on other platforms yet), this does not work consistently across all controls making it harder to make UI tests.
For a
Button
control, this works correctly. TheSemanticProperties.Description
XAML is translated to thecontent-desc
field//android.widget.Button[@content-desc="My semantic properties description"]
and Appium will interpret that correctly as theaccessibility id
. TheSemanticProperties.Hint
XAML is correctly translated to thehint
field.Bug
For the
Picker
control this does not work. TheSemanticProperties.Hint
XAML attributes is propagated to the resulting Android app but theSemanticProperties.Description
is not.Instead, the
SemanticProperties.Description
is emitted as thetext
property of theEditText
view that represents thePicker
control in Android.Steps to Reproduce
Button
and aPicker
like so:platformName
=Android
andappium:automationName
=UiAutomator2
Expected outcome: the
Picker
can be found in Appium using theaccessibility id
which can be set bySemanticProperties.Description
in XAMLActual outcome: the
SemanticProperties.Description
is propagated as thetext
property of theEditText
view in AndroidLink to public reproduction project repository
https://github.com/hansmbakker/PickerAccessibilityBugRepro
Version with bug
8.0.0-preview.6.8686
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android API level 33
Did you find any workaround?
Use XPath to find an element, which is not recommended.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: