Skip to content
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

AutomationID in ToolBarItem still maps to content-desc #27030

Open
SigiNeumann opened this issue Jan 9, 2025 · 0 comments
Open

AutomationID in ToolBarItem still maps to content-desc #27030

SigiNeumann opened this issue Jan 9, 2025 · 0 comments
Labels
t/bug Something isn't working

Comments

@SigiNeumann
Copy link

Description

AutomationID in ToolBarItem maps to content-desc instead of resource-id on Android.
Preface as discussed in related issue #4714 the automation will no longer be mapped to content-desc but to resource-id.
This is true for most elements, but not for ToolbarItems, where the AutomationID still maps to content-desc
e.g.
this XAML,
<ContentPage.ToolbarItems> <ToolbarItem Text="Filter" Command="{Binding ToggleFilter}" AutomationId="Btn_ToggleFilter" /> <ToolbarItem Text="Search" Command="{Binding ToggleSearch}" AutomationId="Btn_ToggleSearch" /> </ContentPage.ToolbarItems>
results in the following Android Layout, with the AutomationID in content-desc.

<androidx.appcompat.widget.LinearLayoutCompat index="2" package="com.adresys.angel.angelapp" class="androidx.appcompat.widget.LinearLayoutCompat" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[613,107][1080,275]" displayed="true"> <android.widget.Button index="0" package="com.adresys.angel.angelapp" class="android.widget.Button" text="" content-desc="Btn_ToggleFilter" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[613,119][757,263]" displayed="true" /> <android.widget.Button index="1" package="com.adresys.angel.angelapp" class="android.widget.Button" text="Search" content-desc="Btn_ToggleSearch" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[757,119][936,263]" displayed="true" /> </androidx.appcompat.widget.LinearLayoutCompat>
My wish would be for it to be consistent. We spent quite some time to transition all tools, tests and

Steps to Reproduce

Create a page in your Maui App.
Add ToolbarItems to your page.
Add AutomationId to ToolbarItem.
Deploy to Android.
Check with UiAutomator (e.g. via Appium)

Link to public reproduction project repository

No response

Version with bug

8.0.40 SR5

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

No response

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

@SigiNeumann SigiNeumann added the t/bug Something isn't working label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant