Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

Expander control doesn't project Automation ID correctly in UI Automation tree #3502

Closed

Description

@jamesmcroft

Describe the bug

A clear and concise description of what the bug is.

When providing an Automation ID to the Expander control in XAML, it cannot be referenced by that ID within a UI test.

Tooling to read the UI suggests that the Expander button shown is the control's root and this has a preset automation ID of PART_ExpanderToggleButton provided by the button's name.

This makes it difficult to reference a specific Expander within a UI test, particularly when there is potential for more than 1 on a page.

  • Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:

Environment

NuGet Package(s): 

- Uwp.UI.Controls

Package Version(s): 

- 6.1.1

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [x] May 2020 Update (19041)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] May 2020 Update (19041)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [x] 2019 (version: 16.7.4) 
- [ ] 2019 Preview (version: )

Activity

  1. added
    bug 🐛An unexpected issue that highlights incorrect behavior
    on Sep 26, 2020
  2. jamesmcroft commented on Sep 26, 2020

    @jamesmcroft
    MemberAuthor

    Looking into sorting this by the way. The problem is the lack of an AutomationPeer.

  3. changed the title [-]Expander control doesn't project Automation ID correctly[/-] [+]Expander control doesn't project Automation ID correctly in UI Automation tree[/+] on Sep 27, 2020
  4. added this to the 7.0 milestone on Sep 29, 2020
  5. michael-hawker commented on Sep 29, 2020

    @michael-hawker
    Member

    Thanks @jamesmcroft for finding these issues and taking a look at them! Much appreciated. 🦙❤

    I've assigned it to you for tracking.

  6. ghost closed this as completedin #3504on Oct 28, 2020
  7. ghost added a commit that references this issue on Oct 28, 2020
    fd511a4
  8. ghost locked as resolved and limited conversation to collaborators on Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions