Skip to content

.NET 8 WPF App - UI Automation Broken - Same App .NET 6 - UI Automation works #8800

Closed

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


[severity:I'm unable to use this version]
We have a WPF application that tested daily via UI Automation tests. We can currently successfully test and record results when we compile our application as a .NET 6 application. However, when we compile the same application as a .NET 8 application the tests fail to detect some UI elements, which causes our tests to fail.

The UI tree in tools such as (UI Spy, Inspect, Accessibility Insights, etc.) we have discovered that some elements are not displayed in the tool's UI tree. For instance, when using the Inspect.exe tool, and we navigate through a wizard, page by page, only the first wizard page's child controls are displayed in Inspect's UI tree. This behavior is exhibited whether using Raw View, Control View, or Content View.

All tools that we have tried exhibit the same problem.


Original Comments

Tom Wells on 2/1/2024, 02:03 PM:

(private comment, text removed)

Tom Wells on 2/1/2024, 03:03 PM:

(private comment, text removed)

Feedback Bot on 2/1/2024, 04:54 PM:

(private comment, text removed)

Ann Yang [MSFT] on 2/1/2024, 07:20 PM:

(private comment, text removed)

Tom Wells on 2/2/2024, 04:00 PM:

(private comment, text removed)

Tom Wells on 2/2/2024, 04:03 PM:

(private comment, text removed)

Ann Yang [MSFT] on 2/4/2024, 07:13 PM:

(private comment, text removed)

Feedback Bot on 2/7/2024, 10:46 PM:

(private comment, text removed)

Tom Wells on 2/8/2024, 02:42 PM:

(private comment, text removed)

Tom Wells on 2/9/2024, 01:42 PM:

(private comment, text removed)


Original Solutions

(no solutions)

Activity

  1. rchauhan18 commented on Feb 13, 2024

    @rchauhan18
    Contributor

    This issue is similar as #8679
    Here is the whole discussion regarding the cause for regression and workaround: #8715

    WorkAround:
    Set the ItemsControlDoesNotSupportAutomation to true before WPF application Initialization.

    public class Program
    {
        [STAThread]
        static void Main()
        {
            AppContext.SetSwitch("Switch.System.Windows.Controls.ItemsControlDoesNotSupportAutomation", true);
    
            var app = new App();
            app.InitializeComponent();
            app.Run();
        }
    }

    I have tried this workaround on the sample application mentioned in the issue and here is the UI automation tree using Accessibility Insights

    image

    We are closing this issue and will continue the discussion on the original issue.

  2. locked and limited conversation to collaborators on Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions