https://github.com/havendv/flaui.fluent
Fluent interface for FlaUI find queries
https://github.com/havendv/flaui.fluent
Last synced: 2 months ago
JSON representation
Fluent interface for FlaUI find queries
- Host: GitHub
- URL: https://github.com/havendv/flaui.fluent
- Owner: HavenDV
- License: mit
- Created: 2020-05-08T08:00:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-22T19:44:03.000Z (over 5 years ago)
- Last Synced: 2025-08-11T04:53:42.611Z (2 months ago)
- Language: C#
- Homepage:
- Size: 466 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# [FlaUI.Fluent](https://github.com/HavenDV/FlaUI.Fluent/)
[](https://github.com/HavenDV/FlaUI.Fluent/search?l=C%23&o=desc&s=&type=Code)
[](https://github.com/dotnet/standard/blob/master/docs/versions/netstandard2.0.md)
[]()Fluent interface for FlaUI find queries
### Notes
- `Application.WaitMainWindow` works correctly without `Thread.Sleep` before this only for **.Net Framework**### Example
```cs
using System;
using System.Diagnostics;
using System.Threading;
using FlaUI.Core.AutomationElements;
using NUnit.Framework;namespace FlaUI.Fluent.Tests
{
[TestFixture]
public class NotepadTests : BaseTests
{
#region Constructorspublic NotepadTests() : base("notepad.exe")
{
ProcessStartInfo.WindowStyle = ProcessWindowStyle.Maximized;
}#endregion
[Test]
public void SimpleTest()
{
#if !NETFRAMEWORK
Thread.Sleep(TimeSpan.FromSeconds(1));
#endifvar window = Application.WaitMainWindow(
Automation,
builder => builder,
Timeout);// Set text
window
.BuildFind().AmongChildren().ByAutomationId("15").Retry(Timeout).First()
.Patterns
.Value
.Pattern
.SetValue("Hello, World!");// Open File menu
window
.BuildFind().AmongChildren().ByAutomationId("MenuBar").Retry(Timeout).Child().First()
.AsMenuItem()
.Click();// Invoke Exit
window
.BuildFind().AmongDescendants().ByAutomationId("7").Retry(Timeout).First()
.AsMenuItem()
.Invoke();// Discard Changes
window
.BuildFind().AmongDescendants().ByAutomationId("CommandButton_7").Retry(Timeout).First()
.AsButton()
.Invoke();
}
}
}
```### Used documentation
1. [FlaUI](https://github.com/FlaUI/FlaUI)
2. [FlaUI Examples](https://github.com/FlaUI/FlaUI/blob/master/src/FlaUI.Core.UITests)
3. [Accessing Standard UIA Properties using FlaUI](https://www.youtube.com/watch?v=EOKPiLykNVE)
4. [FlaUInspect binaries](https://github.com/FlaUI/FlaUInspect/releases)### Contacts
* [mail](mailto:havendv@gmail.com)