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
0 answers

C# - Which interface is not registered and how do I register it?

I am trying to write a console app that will navigate the AutomationElement tree in any open program on Windows 10. My app actually works great with every open program I've tried... except for Chrome. Some installs of Chrome work, but some don't.…
3
votes
1 answer

How to pass POINT structure to ElementFromPoint method in Python?

I'm trying to use method IUIAutomation::ElementFromPoint in Python using comtypes package. There are many examples how to use it in C++, but not in Python. This simple code reproduces the problem on 64-bit Windows 10 (Python 2.7 32-bit): import…
Vasily Ryabov
  • 9,386
  • 6
  • 25
  • 78
3
votes
1 answer

UIAutomation won't work in Windows Server (VPS) if I am not connected via RDP

I have script which uses mircrosoft's UIAutomation to automate an application. The script is inside a VPS running Windows Server 2012. The script works perfectly while I am connected to the VPS via Remote Desktop (RDP). When I am not connected, the…
3
votes
2 answers

Windows UI Automation - Not capturing all subtree elements

I m trying to capture all the sub tree elements of a particular application, in some machines I m getting all the elements, but in some machines half of the elements (i.e. Child Elements) are missing. FindAll(TreeScope.Subtree,…
3
votes
0 answers

UI Automation returns blank AutomationId from IE HTML input text field

I'm using "AddAutomationFocusChangedEventHandler" to capture when an input field in IE is focused on. When the AutomationElement is passed back, the AutomationId is always empty. When I view the field in Inspect.exe, it shows the HTML input fields…
3
votes
1 answer

Need Code coverage info of Source code dlls for MS UI automation

We have a Winforms app which is 10 years old, and has a huge codebase in the UI layer. Writing unit test cases through NUnit or MS test would be a nightmare. So we have opted for UI automation rather than white box testing. Now the difficult part…
Rudrappa
  • 31
  • 1
3
votes
2 answers

Microsoft Automation UI mouse click on a given position

I am developing a C# console application that will open up an application and do some stuff there. I am able to launch the app and login to app. I need to do some mouse click operation on specific positions though but could not find how to do it. Is…
user1244069
  • 95
  • 2
  • 12
3
votes
1 answer

Selecting a checkbox present in a grid using UIAutomation

Selecting a checkbox present in a grid using UIAutomation. Below code returns invalidpattern for invoke pattern: AutomationElement mainGrid = appElement1.FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.AutomationIdProperty,…
Archana DV
  • 31
  • 2
3
votes
1 answer

Get HTML from Outlook's message editor - ControlType.Document

I am trying to fetch HTML from the Outlook. Text format is set to HTML and that is what will be received by the exchange server after I send it. I am able to get text using: if (e.Current.ControlType == ControlType.Document && e.Current.Name ==…
vt100
  • 923
  • 1
  • 11
  • 21
3
votes
0 answers

Automation for Custom WPF Control that hosts Windows Forms Host

I have a custom WPF control based on ContentControl. The control displays power grid, and does its own drawing. I'd like to have elements of power grid available through automation framework. The tricky part is that the control itself has multiple…
Ivan
  • 1,735
  • 1
  • 17
  • 26
3
votes
0 answers

Set AutomationElement visibility or any other property

How can I set IsOffScreen property for Microsoft UI Automation AutomationElement object? I need to hide automation element. I was able to find only TransformPattern and Resize method, but this pattern is not supported by my control (ListView). Is…
incognito
  • 457
  • 5
  • 19
3
votes
0 answers

IUIAutomationElement FindAll/FindAllBuildCache gives null on some machines

I am using UI Automation to get elements from a window. Using the following API's IUIAutomationElement::FindAll IUIAutomationElement::FindAllBuildCache This works on most of the machines and returns null on some machines, though the…
3
votes
4 answers

UI Automation not working for DataGridView

After trying out several solutions, I am in desperate need for help. I tried several approaches, before finally copying and still being stuck with the solution from Getting full contents of a Datagrid using UIAutomation. Let's talk code, please…
Phil Rykoff
  • 11,999
  • 3
  • 39
  • 63
3
votes
2 answers

powershell: how to click a "submit type" input

used powershell to do web ui automation. came up an exception: invoke method failed, because [System.__ComObject] does not contain “click” method. can submit type input be clicked? i used getElementsByTagName getElementsByClassName…
3
votes
1 answer

UIAutomation - How to get around modal dialog blocking using windowopendedevent handler?

I'm trying to build an automated testing frame work for one of our product. Some of the test cases involves performing automation in modal dialog. However, modal dialog blocks the UIAutomation code from executing. In another word, if I have a modal…