Questions tagged [microsoft-ui-automation]

The Microsoft UI Automation (UIA) framework provides programmatic access to most user interface elements on Win32, WinForms, and WPF applications. It is primarily used for the purposes of automated UI testing and accessibility assistance.

The Microsoft UI Automation (UIA) framework provides programmatic access to most user interface elements on Win32, WinForms, and WPF applications. It is primarily used for the purposes of automated UI testing and accessibility assistance.

The UI Automation Framework was introduced in .NET 3.0 with two APIs. A client API which provides a means for obtaining information about UI elements and interacting with them, and a provider API which contains interfaces which developers can implement to enable interaction with non-standard UI elements in their applications.

The UIA framework exposes every UI component as an AutomationElement object. These objects comprise a tree structure wherein the Windows desktop is the root element. Navigation of this tree is primarily accomplished with the client API's TreeWalker object.

Each AutomationElement exposes a set of control patterns which define the way clients can interact them. For example, if the element defines a ValuePattern, a client can get this pattern and store it in a ValuePattern object, and use that objects getValue and setValue methods to access the UI element's value (the text in a textbox for instance).

Originally just available to managed .NET projects, the UIA 3.0 update released alongside Windows 7 introduced a native COM library which boasts improved compatibility, stability, and speed. UIA 3.0 is also available as a separate hotfix KB971513 for Vista and XP SP3.

More Information:

325 questions
28
votes
5 answers

Can UI Automation be disabled for an entire WPF 4.0 app?

We are developing a WPF 4.0 application for internal use. On some clients, we are experiencing huge performance issues due to UI automation (these clients have software installed like tablet service pen, touch, ..). This is a known issue for WPF…
KoenJ
  • 1,093
  • 2
  • 13
  • 24
19
votes
1 answer

What's the difference of UISpy.exe and Inspect.exe? (From Microsoft Windows SDK)

I really want to know, how Inspect.exe gets it's UI-Elements, because it gets by far more elements than UISpy (Both available in Microsoft Windows SDK 7). 1) I think UISpy gets it's elements with UIAutomation library, right? (Tried it with…
user6767845
12
votes
4 answers

Microsoft UI Automation Library Vs Coded UI Test

I'm very much new to Test Automation kind of thing. Recently I've been assigned to a project where I have to write an application (or, a script may be, I'm not sure) that will automate the UI testing of a CAD-like WPF application which misses lots…
atiyar
  • 7,762
  • 6
  • 34
  • 75
12
votes
2 answers

UI Automation events stop being received after a while monitoring an application and then restart after some time

We are using Microsoft's UIAutomation framework to develop a client that monitors events of a specific application and responds to them in different ways. We've started with the managed version of the framework, but due to delay issues, moved to the…
o_weisman
  • 804
  • 7
  • 19
11
votes
1 answer

PowerShell open remote GUI session for UIAutomation

I'm currently working on automatic installation of GUI application using library UIAutomation PS Extensions (https://uiautomation.codeplex.com/). It works pretty well in cases, when I run it against existing Windows user session. I run my PS script,…
10
votes
6 answers

UIAutomation won't retrieve children of an element

I can see that an element with specific Automation ID has children in the Inspect tool: But when I try to retrieve them like this: AutomationElement aPane = mainWindow.FindFirst(TreeScope.Subtree, new…
August
  • 490
  • 3
  • 5
  • 18
9
votes
3 answers

Finding all windows on desktop using UIAutomation .NET

I am trying to find all desktop windows using .NET UIAutomation OR White framework. I tried : 1.) AutomationElement rootElement = AutomationElement.RootElement; var winCollection = rootElement.FindAll(TreeScope.Subtree,…
Varun S
  • 587
  • 4
  • 12
  • 25
8
votes
2 answers

UI Automation events is raised twice

I'm having trouble listening to automation events from the inside a process. I've written a sample below where I have a simple WPF application with a single button. An automation handler is added for the Invoke event on the window with TreeScope:…
jan
  • 865
  • 7
  • 19
8
votes
2 answers

Is it possible to Click a label control on WPF/WinForm App using Microsoft Automation UI

On our application we have a clickable label which will pop up another window. I have been reading through the Microsoft Automation UI documentation, and can't find a way in which I'm able to click a label control. I know that I can't use the Invoke…
ChrisMcLellan
  • 613
  • 1
  • 5
  • 13
8
votes
1 answer

IUIAutomation::RemoveAllEventHandlers hangs

I am developing an app in C++ that uses UIAutomation to receive notification of significant events related to user interaction. I have tried anevent handler by calling AddAutomationEventHandler to listened for window opened events, but I am having…
Wayne
  • 321
  • 1
  • 3
  • 7
7
votes
0 answers

UI Automation Infragistics UltraWinTree Collapse

In Windows Forms we are using Infragistics UltraWinTree control. Goal : collapse all the tree items using UI Automation(UIAutomationClient.dll). For more details about the UI Automation please refer:…
User
  • 804
  • 8
  • 22
7
votes
1 answer

How do I use UI Automation to retrieve text from Edge Browser

It seems that this used to work, but no longer does. Perhaps there is some toggle somewhere that enables it? Using this code private static async Task getText(double x, double y) { try { var location = new…
tofutim
  • 22,664
  • 20
  • 87
  • 148
7
votes
1 answer

AutomationProperties.AutomationId on custom control not exposed

I've been banging my head against this problem for 3 days and haven't been able to find an answer. I've got an application written in WPF (dot Net 4.5) and I'm working with Teststack.White trying to write some automated GUI test cases. The…
Brandon Scriver
  • 303
  • 2
  • 12
7
votes
2 answers

Adding UIAutomation Providers to Delphi controls (specifically grids)

Our VCL Delphi application has a number of grids that we need to start to interact with via UIAutomation. There are a number of issues, not least that the TStringGrid doesn't implement any of the IUIAutomation patterns (IGridProvider or…
mmmm
  • 2,431
  • 2
  • 35
  • 56
7
votes
2 answers

System.Windows.Automation is very slow at enumerating table rows vs. UIAutomationCore

I am trying to do automated testing of my application via UI Automation (mainly using TestStack.White to provide a friendly interface; it uses System.Windows.Automation as a back-end). I have a table with ~200 rows that I need to test the values of…
1
2 3
21 22