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

How to get raw element from AutomationElement

How can i get the actual UWP control element from AutomationElement Below API returns AutomationElement parent.FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.AutomationIdProperty, automationId)); I want to assert the…
Pavan Tiwari
  • 3,077
  • 3
  • 31
  • 71
2
votes
0 answers

How to quickly retrieve elements from UI automation tree using C#?

I need to get the list of chat conversation from the Skype UI Automation tree. The Automation tree is shown below: So, in the automation ui tree above, the tree nodes that ends with "nodes" are the conversations along with few system…
Avishekh Bharati
  • 1,858
  • 4
  • 27
  • 44
2
votes
0 answers

Windows UIAutomationElement memory leak

I have a WPF application that needs to be automatized for the purpose of testing. There is an existing tool that does this using Windows UIAutomation framework. The problem with that is when I try to access elements on the main app and to trigger…
2
votes
0 answers

What decides which part of the common XAML controls is accessible through UIAutomation

I am trying to automate UI testing through WinAppDriver of a UWP app. The doc says that anything that is visible through the inspect.exe (i.e UIAutomation) could be controlled through WinAppDriver. This means the basic controls can be accessed…
2
votes
1 answer

How to capture UIAutomation event

I need to monitor changes in the google chrome url textbox. I have the code the finds the url and correctly reads it. AutomationElement elementx = element.FindFirst(System.Windows.Automation.TreeScope.Descendants, conditions); return…
Eminem
  • 7,206
  • 15
  • 53
  • 95
2
votes
1 answer

Windows UIAutomation sometimes hangs other apps

I'm using UIAutomation via COM interface in my WPF client app. Some users sometimes are taking hangs of their specific apps (like nVidia Control Panel). My app recieves that exception: System.Runtime.InteropServices.COMException (0x80131505):…
Mikolaytis
  • 921
  • 1
  • 12
  • 27
2
votes
1 answer

UI Automation - How to distinguish image being displayed

I am very new to UI Automation and using Inspect tool (Inspect.exe Microsoft tool), so please explain. I have a UWP application showing a list view, each list view item looks like this The little circle in Image block above is the InteriorColor…
pixel
  • 9,653
  • 16
  • 82
  • 149
2
votes
1 answer

Identifying a WPF Control with White UI Automation using search criteria as an "OR" statement

I'm currently trying to automate the testing of a WPF application, and have several controls where the automationID is determined at run time (currently the problem is a toggle button that has been morphed into a drop down menu, where the text of…
2
votes
1 answer

Windows UI Automation tools (Visual UIAVerify, Inspect.exe) recognizes the Buttons as Pane

I am using UI Automation library - TestStack.White to automate a Windows Application, where I utilize Inspect.exe to get the UI Elements from the WinForms. I have had no issues with the Inspect.exe so far except currently I am stuck with an issue in…
2
votes
2 answers

Are there any dependencies for UI Automation?

I have a Windows application which captures the details from screen based on the configuration. I am using UI Automation to capture the details from the screen. Everything works fine on the developer's machine where Visual Studio is installed. When…
2
votes
1 answer

Unable to get deepest IUIAutomationElement without one of Inspect.exe, Magnify.exe, Narrator.exe running

I'm able to get some IUIAutomationElements inside Windows applications ONLY when an app 'X' (Inspect.exe | Narrator.exe | Magnify.exe) is running. Without 'X' running, the application from which I'm trying the get the IUAutomationElement essentially…
2
votes
1 answer

TextBox throws Unsupported Pattern in Value Pattern

Does anyone know how to set a value in the TextBox after enabling TextBox in runtime using UI Automation and .Net? For more information: initially while loading the application, the TextBox was disabled. After toggling the check box using…
2
votes
2 answers

The target element corresponds to UI that is no longer available

AE_ComboBox = uia.GetElementByControlTypeAndAutomationId(globalSettings, ControlType.ComboBox, "1"); AE_TargetValue = uia.GetElement(AE_ComboBox, value, true); SelectionItemPattern SIP = AE_TargetValue.GetCurrentPattern(SelectionItemPattern.Pattern)…
user1947415
  • 933
  • 4
  • 14
  • 31
2
votes
1 answer

Can we automate remote machine using UI automation

I have code which logs into rdp, but I am not able to inspect any element: using System.Text; using System.Threading; using System.Threading.Tasks; using System.Windows.Automation; using System.Windows.Forms; using…
Manas
  • 21
  • 2
2
votes
1 answer

Windows UI Automation: Get selected object from C# ListBox control

A little background: I'm currently writing a sample project using Winforms/C# that emulates Conway's Game of Life. Part of this sample involves UI Automation using the White Automation Framework. The relevant layout of the form includes a custom…
E. Moffat
  • 3,165
  • 1
  • 21
  • 34