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
3
votes
2 answers

Windows UI Automation API not finding child elements when run on server

I'm using the Microsoft UI Automation API from within NUnit 2.5.10 tests to perform automated UI testing for a WPF application. There some cases where running the tests on my development machine is able to locate certain UI elements, but when the…
John M. Wright
  • 4,477
  • 1
  • 43
  • 61
2
votes
1 answer

Windows UI Automation API

I have been trying to figure this out for a while so any help would be greatly appreciated. I am using UI Automation in my client to monitor and report on user selection within another application. I got the code working perfectly on Server 2003. On…
2
votes
1 answer

Convert IUIAutomationElement to IUIAutomationElement6, to invoke get_CurrentFullDescription method

I need to get fullDescription property of a UI element using get_CurrentFullDescription method of UIAutomation library of c++ windows. Issue is I have element as IUIAutomationElement instead of IUIAutomationElement6, get_CurrentFullDescription can…
AtiqGauri
  • 1,483
  • 13
  • 26
2
votes
0 answers

Are there updated UIAutomation DLLs? (creating custom pattern in c#)

In my WPF c# program, I'm trying to implement a custom pattern for Windows UIAutomation, which means I need to import something that knows about IUIAutomationPatternHandler, and the only way I can find to that is to add a COM reference to…
Betty Crokker
  • 3,001
  • 6
  • 34
  • 68
2
votes
0 answers

How to use Dynamic annotation with Microsoft UI Automation?

MSAA (Microsoft Active Accessibility) allows dynamic annotation wherein certain accessibility properties of controls can be set without having to re-implement MSAA interfaces. Specifically server annotation (which is a type of dynamic annotation)…
2
votes
1 answer

Checkbox (checked or unchecked)

While using automation client I am iterating over all the elements of the window. And I want to get button... [![enter image description here][1]][1] Here is code... How can I get any of these 3 property values without running through another UI.
AtiqGauri
  • 1,483
  • 13
  • 26
2
votes
0 answers

UI Automation example error: LNK2001 unresolved external symbol _CLSID_AccPropServices

I want to edit dialog control properties so the UI is fully accessible for screen readers. I have tried the following code sample (from https://learn.microsoft.com/en-us/accessibility-tools-docs/items/Win32/Control_Name) // At the top of the C++…
2
votes
1 answer

What is a wil::ResultException and what does it mean to rethrow?

Using UI Automation for some Windows I get the following exceptions on a IUIAutomationElement::FindAll() call using VS2017. First question, what is a wil:ResultException and what does it mean it rethrow at memory address 0? I check the FindAll()…
user3161924
  • 1,849
  • 18
  • 33
2
votes
0 answers

Microsoft Edge does not fire UIA HandlePropertyChangedEvent when window title property changes

I'm trying to get notified when the Window title of an MS Edge browser window changes using UIAutomation but the property changed event is not firing as I would expect. The code works for IE, Chrome and FireFox and the only noticeable difference I…
Tim
  • 495
  • 1
  • 4
  • 10
2
votes
1 answer

Coded UI Test vs. Microsoft UI Automation library

I want to do UI testing of my complex WPF application. I have come across two libraries for UI Automation: Coded UI Test Microsoft UI Automation Library. I am confused in above two options. Please let me know where should I use which…
2
votes
2 answers

Get attributes from UI element with Microsoft UIAutomation and Python

Goal: I want to retrieve the following attributes of a UI element: Name, Class, Control type and parent name. The element could belong to Outlook or web application which is opened on Internet explorer. Python interpreter: 3.7 Python library:…
sergioMoreno
  • 189
  • 1
  • 15
2
votes
1 answer

Why are exceptions, that are caught in the UI automation client, appearing in the UI being automated?

A little background... I am developing a UI automation app that randomly interacts with controls on our UI. Both the app and the UI being automated are WPF applications. I am using the UI Automation accessibility framework. Occasionally I get an…
2
votes
0 answers

Windows UI Automation: How to set Automation ID to HTML elements?

I am using Windows UI Automation for desktop applications. UI Automation seems to be able to find elements in the HTML of embedden WebBrowser controls as well, but I could not find a way to give these elements an Automation ID. I tried…
Heinz Kessler
  • 1,610
  • 11
  • 24
2
votes
1 answer

Getting the path of a button using UIAutomation

I'm trying to get a button of another app unique path because i want to save it in order to access it another time after i close the app on another run. I am interested in any possible way to save a path which i can follow to access the button…
2
votes
1 answer

How to search children/descendants by regular expression title in pywinauto?

I am trying to get children/descendant UI elements of another UI element by a regexp title. For example, the following code should work. from pywinauto.application import Application, WindowSpecification root_ws: WindowSpecification = ( …