Authors and runs FlaUI-based Windows UI tests - the .NET-native wrapper around Microsoft UI Automation (UIA2 + UIA3). Covers the `FlaUI.Core` / `FlaUI.UIA2` / `FlaUI.UIA3` NuGet packages, `Application.Launch` / `Application.Attach` lifecycles, `ConditionFactory` + `FindFirstDescendant` locator patterns, `Retry` waits, and xUnit / NUnit / MSTest harness integration. Use when the test stack is C# / .NET-first and the team wants idiomatic in-process UIA calls rather than the HTTP/JSON wire protocol of `winappdriver` or the Appium proxy layer of `appium-windows-driver`.
74
93%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Alternate locator forms and the CI workflow, kept out of the SKILL spine. See SKILL.md for the core launch, find, interact, and wait flow.
Sources: FlaUI Searching wiki, Microsoft Learn - UI Automation Overview.
The lambda form (in SKILL.md) is the shortest and the upstream convention. Two equivalent forms resolve to the same UIA query:
// ConditionFactory form
var b = window.FindFirstDescendant(ConditionFactory.ByAutomationId("LoginButton"));
// Property + tree-scope form
var b3 = window.FindFirst(
TreeScope.Descendants,
new PropertyCondition(
Automation.PropertyLibrary.Element.AutomationIdProperty, "LoginButton"));FindFirstChild / FindAllChildren - immediate children only.FindFirstDescendant / FindAllDescendants - full subtree.FindFirstNested / FindAllNested - multi-level condition arrays.Condition constructors: ByAutomationId, ByName, ByText, ByClassName,
ByControlType, plus boolean combinators AndCondition / OrCondition /
NotCondition.
ByAutomationId - developer-set stable identifier per msuia2;
locale-independent and theme-independent.ByControlType + a nested condition - when no AutomationId is available,
pair the control type (Button / Edit / ListItem) with another property.ByName - last resort; localised apps change Name per language.Windows runner required - UIA is Windows-only per msuia2.
windows-latest provides an interactive desktop session by default, required
because UIA cannot drive Session-0 / non-interactive desktops. Self-hosted
Windows-container runners need interactive logon + Auto-Login + an unlocked
desktop.
# .github/workflows/flaui.yml
jobs:
ui-tests:
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-dotnet@v4
with: { dotnet-version: '8.0.x' }
- name: Build app under test
run: dotnet build src/MyApp -c Release
- name: Run FlaUI tests
run: dotnet test tests/MyApp.UiTests --logger "trx;LogFileName=ui.trx"
- uses: actions/upload-artifact@v4
if: always()
with:
name: trx-results
path: '**/ui.trx'