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

How to find specific element within the iframe of electron app?

I am using the code similar to this one https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-howto-find-ui-elements#finding-an-element-by-name for getting specific element within a window and it doesn't work if my element is inside iframe…
N.Sto
  • 37
  • 5
0
votes
0 answers

Windows UIAutomation throwing confusing errors

I'm using Windows UIAutomation quite heavily and it works mostly well. But it's throwing some exceptions that I haven't been able to figure out. The first of these is: Exception thrown at 0x762D46D2 (KernelBase.dll) in MyApp.exe: 0x80040155:…
DukeBrymin
  • 351
  • 3
  • 15
0
votes
1 answer

Get HWND under the cursor to use with UIAutomation

I'm trying to get the info about the current window under the cursor, I got the function working when I manually specify the hwnd, how I could get the hwnd from the current window under the mouse? #include POINT…
user14881255
0
votes
0 answers

C# UIAutomation crashes Excel

we are using .NET-Framework UIAutomation in our WPF application. We want to be notified when user switches to another Microsoft application, e.g. Excel. Here is our code to register the eventhandler: automationFocusChangedEventHandler =…
Haimo
  • 51
  • 5
0
votes
2 answers

WPF UI Automation - Control Tree not poluated till region is clicked for a TabControl

I am doing a UI automation for a WPF application using the Microsoft UI Automation library and it works well. However my app has four screens in a TabControl. Even when I click the tab item through code its child control tree isnt populated. The…
ganeshran
  • 3,512
  • 7
  • 41
  • 69
0
votes
1 answer

Windows UI Automation - Not Finding Window

I'm working on a VBA program to help automate a task using UI Automation, but I've run into an issue where the window of the program I'm trying to control does not show up as a child of the Root Element (desktop). It's my understanding that all…
Bob
  • 1
0
votes
1 answer

C++ UIA TextPattern is not found on RichEdit control in Win 7, but C# UIA does find it

On Win 7 SP1 with Convenience Update (latest Win 7 that was shipped), my C++ code using CUIAutomation from Windows Automation 3.0 cannot get the TextPattern from the RichEdit control in the built-in WordPad application. However, the equivalent C#…
David Ching
  • 1,903
  • 17
  • 21
0
votes
2 answers

Setting automationIDs for dataitems in a WPF Grid for automation with UI Automation Framework

I've got an application that's written in C# using .NET Framework 3.5 and want to automate the UI using Microsoft UI Automation Framework. I'm not allowed to show everything here, because it's a software from my company. In this application I'm…
Turbine
  • 15
  • 3
0
votes
1 answer

Can I access this control with UI Automation?

I am trying to access this list of checkboxes in an Autodesk Revit dialog with UI Automation. But when I look at the dialog with Inspect and UISpy, the list or checkboxes are not shown. There is an "Add selection to:" pane and the scrollbars that…
0
votes
1 answer

how to access ui structures(textboxes,labels) inside static function MouseProc, SetWindowsHookEx?

In my .h file function mouseProc is declared as static(it has to be) .h file static LRESULT CALLBACK mouseProc(int Code, WPARAM wParam, LPARAM lParam); initially i thought i would add &ui as a parameter to this function, but i am not able to do so.…
0
votes
0 answers

Windows UIAutomation "The object invoked has disconnected from its clients" when application ends?

In a smaller test program using UIAuotmation and CoInitializeEx(NULL, COINIT_APARTMENTTHREADED) I have no problems running in x64 debug mode in VS2017. On a larger MFC app (x64 debug) that uses AfxOleInit() I get the The object invoked has…
user3161924
  • 1,849
  • 18
  • 33
0
votes
0 answers

Does UI Automation ScrollPattern have a Bounding Rect or is there a reliable way to get it?

I've been messing around with UI Automation and Scrolling. I found that in notepad if you take the bounding rectangle of the scrollable window, subtract out the size of any scrollbar bounding rectangles, it scrolls perfectly. However, trying the…
user3161924
  • 1,849
  • 18
  • 33
0
votes
1 answer

Why doesn't UI Automation condition find element by UIA_IsScrollPatternAvailablePropertyId?

I wanted to find the element within a main window handle that allows scrolling. So instead of finding scrollbars and then the owner of the scrollbars I wanted to just return the items that allow scrolling via a ScrollPattern so I setup the…
user3161924
  • 1,849
  • 18
  • 33
0
votes
1 answer

How to maintain a list of the items currently visible in Explorer's items view

I'm trying to maintain a list (i.e., a vector or set) of IUIAutomationElements representing the items in Explorer's items view. I've already obtained an IUIAutomationElement for the items view itself, so from there I'm essentially trying to keep…
user13366655
0
votes
0 answers

Not able to find control in minimised window using UIAUTOMATION in c#

Trying find a checkbox and few buttons from a windows application. When application window is active, able to toggle and invoke button patterns but when window is minimised, getting null reference, find the sample code below PropertyCondition…
Sidh Sand
  • 1
  • 1