Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Automation Ids are not showing in the UI Automator Viewer #15532

Open
gab5890 opened this issue Sep 1, 2022 · 4 comments
Open

[Bug] Automation Ids are not showing in the UI Automator Viewer #15532

gab5890 opened this issue Sep 1, 2022 · 4 comments
Labels
s/unverified New report that has yet to be verified t/bug 🐛

Comments

@gab5890
Copy link

gab5890 commented Sep 1, 2022

Description

Since Xamarin.Forms version 5.0.0.2478 and newer, the UI Automator Viewer or any other similar app doesn't show the "AutomationId" (Content desc) the second time you request it. To make it work again, you need to reset the app.

Steps to Reproduce

Create a project
Add Xamarin.Forms nuget version 5.0.0.2478
Add a label with a Automation Id
Request for UI hierarchy with UI Automator Viewer or any other similar app two times

Expected Behavior

Automation Ids are available anytime

Actual Behavior

Automation Ids doesn't show up the second time and every other time

Basic Information

  • Version with issue: 5.0.0.2478 and newer version
  • Last known good version: 5.0.0.2401

Screenshots

First time
image

Second time
image

Code
image

@gab5890 gab5890 added s/unverified New report that has yet to be verified t/bug 🐛 labels Sep 1, 2022
@jfversluis
Copy link
Member

hey @gab5890, a PR (#15436) that seems related has been merged, would you be able to grab the NuGet as described here and let us know if this fixes this issue? That will greatly speed up the review process.

Besides verifying if this particular issue is fixed also be sure to check other scenarios in the same area to make sure that this fix doesn't accidentally has side-effects 🙂

Thanks!

@gab5890
Copy link
Author

gab5890 commented Sep 8, 2022

Hi @jfversluis, I've updated to the version 5.0.0.8261 and I'm still having the issue.
Let me know if you need anything.

@askariya
Copy link

askariya commented May 17, 2023

Hi, @jfversluis, I don't see how #15436 can fix the problem.
It is modifying the viewIdResourceName, which I believe changes what will be displayed in resource-id (I'm not entirely sure why package name is included here as well, it makes automation more difficult):
info.ViewIdResourceName = $"{host.Context.PackageName}:id/{element.AutomationId}";

The comment next to this line in the commit mentions that this is what is used by Appium and other automation frameworks, but typically I think most automation frameworks use the AutomationId which is actually mapped to content-desc, not resource-id.

@valentasm1
Copy link

Imo need to move on to maui since such fixes wont happen in xamarin.forms.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
s/unverified New report that has yet to be verified t/bug 🐛
Projects
None yet
Development

No branches or pull requests

4 participants