dotnet add package Flanium --version 18.104.22.168
NuGet\Install-Package Flanium -Version 22.214.171.124
<PackageReference Include="Flanium" Version="126.96.36.199" />
paket add Flanium --version 188.8.131.52
#r "nuget: Flanium, 184.108.40.206"
// Install Flanium as a Cake Addin #addin nuget:?package=Flanium&version=220.127.116.11 // Install Flanium as a Cake Tool #tool nuget:?package=Flanium&version=18.104.22.168
Flanium is an all-purpose RPA Library created for Windows.
Flanium is made by joining two frameworks:
- Selenium - Selenium is a suite of tools for automating web browsers.
- FlaUi - FlaUI is a .NET library which helps with automated UI testing of Windows applications (Win32, WinForms, WPF, Store Apps, ...).
Flanium only supports Windows and Chrome browser for now. [12/08/2022]
Your very first web automation (a short tutorial on WebEvents)
First start off by opening Visual Studio (not Visual Studio Code) or maybe Jetbrains Rider, and create a Console Application in .NET 6 (Windows), then follow the instructions below.
The initializers in the Initializers library are dumb-proof, but you can make your own if you want, but these are generally the ones I would start with when making my web based RPA.
var chromeWeb = Initializers.InitializeChrome(Initializers.InitializeService);
This will create your Chrome browser with a plethora of useful arguments and other superpowers, it disables all of the logging that the base chromedriver has, so it leaves the console application open for writing without interruptions.
Now we have it open, then we would need to navigate to a webpage, let's choose https://www.codeproject.com/.
Then we want to click an element, I want to click the "Quick Answers" button on the homepage, I would do it like this:
That's it, now you've clicked the "Quick Answers" button.
Now perhaps I am curious about what text does the first answer have in the table that just appeared.
var answerText = WebEvents.Action.GetText(chromeWeb, "//*[@id='ctl00_ctl00_MC_AMC_Entries_ctl01_QuestionRow_H']");
I now have retrieved the text of the first question, for me it was "How do I pass variables from one PHP page to another".
Since I have all the information I need, I will now close the chrome session like this:
And now we're done, our very first automation done easily.
All of the event libraries have built in logging for them, so you will see the results of the code in the Console Application.
The logging no longer looks like in the example image, but the general idea is the same.
|Product||Versions Compatible and additional computed target framework versions.|
|.NET||net6.0-windows10.0.17763 is compatible.|
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.