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

c++ com how to inherit IUIAutomationPropertyChangedEventHandler interface

c# code: var nativeAutomation = new UIAutomationClient.CUIAutomation8(); nativeAutomation.AddPropertyChangedEventHandler(ele, UIA.TreeScope.TreeScope_Element, null, new handler(), pidarray); the handler used in AddPropertyChangedEventHandler class…
rookie
  • 161
  • 2
  • 7
0
votes
0 answers

Why does AccessibleChildren not return the same number of elements as specified?

When calling AccessibleChildren the call convention is as follows: HRESULT AccessibleChildren( IAccessible *paccContainer, LONG iChildStart, LONG cChildren, VARIANT *rgvarChildren, LONG *pcObtained ); Example…
Sancarn
  • 2,575
  • 20
  • 45
0
votes
0 answers

Handle not supported property with FlaUI?

This is my current code, that sometimes fails and that gives me that exception: An exception of type 'FlaUI.Core.Exceptions.PropertyNotSupportedException' occurred in FlaUI.Core.dll but was not handled in user code. The requested property 'Name…
0lan
  • 179
  • 1
  • 14
0
votes
0 answers

Issues automating a WPF with dynamic 'AutomationID' and no 'Name' property - C#

I have been working on an attempt to automate a Windows Program using C#. After using Inspect.exe from Windows Kits (SDK), it seems that many of the elements that I am trying to work with do not have a static AutomationID, an element Name, etc. The…
0
votes
0 answers

Interact with UWP Windows application using Microsoft UI Automation

I have to write a program to open a UWP Desktop application on Windows 10 PC and perform some operation and close, this should be run at constant intervals. I have checked WinAppDriver and Microsoft UI Automation testing frameworks. WinAppDriver…
MobDev
  • 1,489
  • 1
  • 17
  • 26
0
votes
1 answer

Issue with setting AutomationElement value

I have an issue with setting value of AutomationElement by using method ValuePattern.SetValue(). Everything works just fine until some dialog appears. When the dialog appears the code execution got stuck. No exception is thrown. After the dialog is…
0
votes
0 answers

Excel VBA IUIAutomation: How to SaveAs in IE11 (instead of "Save" and "Open") or Ensure Excel File Opens If Subsequent Code Is Added?

So I've success navigated to a website, clicked the download icon button, and successfully clicked the "Save" and "Open" popup dialogue in IE11 to open a .CSV file in Excel. The problem is that if I add even a single line of code after that, with…
0
votes
0 answers

How to get URLs from Chrome

You can get the Chrome URL using uiautomation. However, Chrome UI menu is not visible on some PCs. Is there another way? UI Menu Success: UI Menu Failed: varPropAddr.bstrVal = SysAllocString(L"Address and search…
hhbae
  • 1
  • 1
0
votes
1 answer

How to manipulate a window which is in Off Screen status by UI Automation

I click on the "save" button from a window named 'Main', then a new window named 'Save As ..' will pop up. But actually, that 'Main' window is always in minimized status and its IsOffscreen property is True showed in Tool UISPY, so when it is…
Jim
  • 35
  • 1
  • 8
0
votes
1 answer

Retrieve toolstripbutton using UIAutomation

Using UIAutomation on windows Forms, I'm trying to retrieve any control under mouse on a specific form. The goal is to work on controls of an app, retrieving and acting on them. The problem I'm facing since so many times is that I can't find a…
0
votes
1 answer

Firefox fails tree traversal, further investigation shows messed tree hierarchy

I am using UIA to traverse through Firefox element tree. I am creating paths between multiple nodes in the tree. This however is running into problems because there seems to be mix up of elements in the tree. That is there are duplicate runtime ids…
0
votes
1 answer

string value is blank then don't use in condition

private string FindValue(AutomationElement f_Element) { object l_PriorityFirstValue = GetValue(0); object l_PrioritySecondValue= GetValue(1); object l_PriorityThirdValue GetValue(2); AutomationElementCollection…
ND's
  • 2,155
  • 6
  • 38
  • 59
0
votes
1 answer

Missing child comparing inspect.exe to UIAComWrapper.dll returned value of AE.RootElement.FindAll(TreeScope.Children, Condition.TrueCondition)

I am trying to to interact with a third party application. I want to save text values displayed by the client for auditing purposes. There were many missing elements when using UISpy.exe, and a complete list when using Inspect.exe. This lead me to…
0
votes
0 answers

UIACOMWrapper: InvalidOperationException when removing AutomationEventHandler

I used the next code to wait for window opened: Automation.AddAutomationEventHandler( WindowPattern.WindowOpenedEvent, AutomationElement.RootElement, TreeScope.Children, (sender, e) => { var element = sender as…
Taras Kozubski
  • 1,854
  • 1
  • 20
  • 33
0
votes
1 answer

Coded UI, search properties for text controls

I have problems with text controls recording. My tested application: desktop, WinForms, .NET 4.6 When I use "Coded UI Test Builder" then for new text controls it automatically creates following search properties: ControlType: Text …