3

In the WinappDriver for Appium, I have the following method on WindowsElement:

FindElementsByWindowsUIAutomation()

I have searched for documentation on what this selector is and can do, but I hardly found relevant hits for the term itself.

Can anybody offer some help?

FWIW: there is, for example, something similar for -ios uiautomation (obsolete).

2 Answers 2

3

UI Automation (often refered to as UIA) relates to a set of interfaces designed to allow one programs to interact with or to control another via the screen, keyboard and mouse. The intention is to allow programs such as screen readers and alternatives to keyboard and mouse to be used with (almost) any application. Hence most applications can be used by people with impaired vision or dexterity problems (or more crudely put: people with disabilities).

Microsoft also support the MSAA interface (Microsoft Active Accessibility) which is an older interface with the same goals. MSAA was released with Windows 95 and UIA with Vindows Vista. See here for more about both.

Having got the UIA or MSAA interfaces to an application, other programs can interact with it. This includes automated testing. Test systems such as Microsoft's Coded UI use the UIA and MSAA interfaces of an application.

Most of the Microsoft application developement frameworks (such as Windows Forms, WPF and MFC) provide proper support for either MSAA or UIA. The problem is with custom controls. They need to include support for UIA or MSAA otherwise they will not work with the screen readers etc. I have not found any good documentation on how to write the required support code.

3
  • Nice answer. Would it be possible to provide an example usage in the context of Appium? Because there you can only pass a selector, but MSDN only has example code for AutomationElement which seems to work rather differently than Selenium/Appium. Didn't find any "selectors".
    – FDM
    Commented Jul 3, 2017 at 8:57
  • @FDM I know Coded UI but not how to write the MSAA or UIA support code, nor do I know Appium. Perhaps someone else can help you.
    – AdrianHHH
    Commented Jul 3, 2017 at 9:10
  • No problem. I accepted your answer because I did ask "what is" and not "how to". Thanks anyway.
    – FDM
    Commented Jul 3, 2017 at 9:12
2

This answer is just in case people were circling around FindElementsByWindowsUIAutomation() hoping that it would return the elements with a given AutomationID (as per driver.PageSource).

If you're attempting to acquire an element by AutomationId on with WinAppDriver (and you don't want to use XPaths) then you can use yourElement.findElementsByAccessibilityId("TheRelevantAutomationId")

See: http://appium.io/docs/en/drivers/windows/#inspecting-ui-elements

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.