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
4
votes
1 answer

How to use IUIAutomation::ElementFromIAccessible method in C#?

I've tried to use ElementFromIAccessible method via: System.Windows.Automation; ... [DllImport("UIAutomationClient.dll")] public static extern int ElementFromIAccessible( IAccessible accessible, int childId, [In, Out,…
4
votes
1 answer

Custom Condition for UIA

Is there a way of writing your own System.Windows.Automation.Condition class? I don't know how this class works because it offers no public method to define the comparison behavior. Background: I use the UIAutomation library to find elements the…
Marcel Bonzelet
  • 238
  • 2
  • 13
4
votes
0 answers

Automation - TreeItems of WindowsFormsApplication Cannot be Captured Properly

[Automation] TreeItems of WindowsFormsApplication with target framework .Net 4.5.2 running on WinServer2012 R2 cannot be captured I've created a sample windows application project containing a TreeView with two nodes. Each of the two nodes has child…
Back2WorkMinion
  • 221
  • 1
  • 2
  • 8
4
votes
3 answers

MS UI Automation- AddAutomationHandler not firing

I'm using Microsoft's UI Automation tools to add change handlers to a textbox. The code is below: // Get a reference to the textbox. var textbox = window.FindFirst( TreeScope.Descendants, new…
Jeff
  • 1,800
  • 8
  • 30
  • 54
4
votes
1 answer

Is there any internal timeout in Microsoft UIAutomation?

I am using the UI Automation COM-to-.NET Adapter to read the contents of the target Google Chrome browser that plays a FLASH content on Windows 7. It works. I succeeded to get the content and elements. Everything works fine for some time but after…
Patrik
  • 1,286
  • 1
  • 31
  • 64
4
votes
1 answer

Should I be using AutomationPeer or AutomationElement? Or both?

I have just started using AutomationElement because we want to do integration testing of our custom controls, and I think I should be using AutomationElement. I have successfully created a Window with a custom control in it, and can successfully…
Diana
  • 789
  • 8
  • 34
4
votes
1 answer

How to check a checkbox with microsoft uiautomation?

I need to automate the madvr gui and enable smooth motion with uiautomation. But can't find recent and easy working samples. The madvr window identification: The madvr smooth motion checkbox identification: My actual code: using System; using…
baltazer
  • 259
  • 1
  • 5
  • 12
4
votes
1 answer

Getting list of underlying menu items via UIAutomation with Delphi

I have been trying to get a list of menu sub-items from a standard Windows application using the UIAutomationCore library imported as a TLB into Delphi - i.e. File -> New | Exit Help -> About I can get the application menu, and then the top-level…
mmmm
  • 2,431
  • 2
  • 35
  • 56
4
votes
2 answers

Can I get a bitmap of an arbitrary window in another application process?

I am trying to automate a third-party Win32 application where I want to capture the graphics content of a particular window at defined time intervals. I am in the early phases of this, and I'm currently trying to use the Microsoft UI Automation API…
Chris Farmer
  • 24,974
  • 34
  • 121
  • 164
4
votes
1 answer

MSAA finds controls UI Automation doesn't

I'm working on automating a windows application. I'm using the teststack white framework. I've hit a problem. This program has a 'Window' object that I cannot see inside of. White shows no controls inside of it. The Inspect.exe shows no controls…
JonM
  • 41
  • 1
  • 3
4
votes
1 answer

How to recognize WPF drawing visuals in UIAutomation?

Our application has a canvas, to which we add the drawing visuals (like lines, polygons etc) // sample code var canvas = new Canvas(); // create canvas var visuals = new VisualCollection(canvas); // link the canvas to the visual…
Schu
  • 1,124
  • 3
  • 11
  • 23
4
votes
1 answer

Some controls on a page are not visible for MS UI Automation

We have an application with StartPage.xaml, where control template for TabControl defines some grids and stack panels. There is an itemPresenter in that template in the middle of the xaml, and a stack panel below it. While it works fine for a user,…
DarkDeny
  • 1,750
  • 2
  • 21
  • 31
3
votes
1 answer

Is it possible to get the selected text of any window including non-UI automation elements?

Is it possible to get the selected text of any window including non-UI automation elements? I want to be able to get the selected text of the current contents of the currently focused element of any process. I've seen various examples of using UI…
jaffa
  • 26,770
  • 50
  • 178
  • 289
3
votes
0 answers

Applications crash when automated by a ui automation

I am automating an application with python using the uiautomation library. En python 3.6.8 I can access any element of the application without problems when I use the method control = auto.ControlFromCursor () print (control.AutomationId,…
Danilo Toro
  • 569
  • 2
  • 15
3
votes
2 answers

Using Caching with AutomationElements does not give me a speedup - intended or wrong usage?

I am trying to increase the speed of some UI Automation operations. I stumbled across the (not so well) documented caching possibility. From what I have understood, the whole operation (if you have a large GUI-tree) is so slow, because for every…
Andreas Reiff
  • 7,961
  • 10
  • 50
  • 104
1 2
3
21 22