Skip to content
riQQ edited this page Oct 26, 2022 · 27 revisions

Can I use UIA2 and UIA3 at the same time?

Theoretically yes but practically it seems to have some issues. It seems that as soon as you loaded UIA2 in a process or appdomain, all further results in the same process will always be like you use UIA2 even though you use UIA3. So the best is to have UIA2 and UIA3 in different processes

How can I improve performance issues in an UI application which uses FlaUI?

Basically it should just work. But if you use some FlaUI methods which interact with your application itself from the UI thread of your application, you might see weird behaviors (for example if you register for the FocusChangedEvent).
Best is, to use a separate task for those calls.
More information: MSDN: Understanding Threading Issues

Can FlaUI be used to automate Chrome?

Chrome does not provide accessibility by default. But you can activate that by running Chrome with the command line argument --force-renderer-accessibility or by setting the accessibility settings by opening chrome://accessibility/ in Chrome.

What things work with only with UIA2 or only with UIA3?

Currently know are the following:

UIA2 only

  • The WinForms Slider works as expected in UIA2 but in UIA3, it always has a range from 0-100.

UIA3 only

  • The WinForms Spinner does not work at all in UIA2, in UIA3 you can get and set values with the nested edit control. You cannot use the RangeValuePattern neither in UIA2 nor in UIA3.

Various strange behaviour encountered

  • The native GetClickablePoint might return an exception but the property ClickablePoint returns a correct point.

Can I use FlaUI with Java UI frameworks?

  • JavaFX has limited support for UIA. Many of the UIA patterns are not supported but since FlaUI moves the mouse cursor and sends mouse clicks it should be possible to interact with most applications.
  • Swing has no support for UIA.
  • More information on using FlaUI with Java UI frameworks can be found here #127

How can I run FlaUI tests on a build server/agent?

This can get tricky. In general, UI tests need a desktop session in order to interact with the application. Altough it is possible to run the tests without a desktop session if they solely work with UIA patterns (so no mouse). In order to get a desktop session to also use the mouse, the following tips might help you:

  • Make sure the build agent automatically logs in a user on startup (by using the Registry). As an alternative, you can try to RDP to the build agent before running tests automatically (for example with FreeRDP).
  • Make sure to never disconnect from RDP with just closing, use a script like tscon 1 /dest:console or even better: Don't use RDP, use VNC (like TightVNC) which never closes a users desktop session.