Flanium 2.0.2.6

dotnet add package Flanium --version 2.0.2.6
NuGet\Install-Package Flanium -Version 2.0.2.6
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Flanium" Version="2.0.2.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Flanium --version 2.0.2.6
#r "nuget: Flanium, 2.0.2.6"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Flanium as a Cake Addin
#addin nuget:?package=Flanium&version=2.0.2.6

// Install Flanium as a Cake Tool
#tool nuget:?package=Flanium&version=2.0.2.6

Flanium

Flanium is an all-purpose RPA Library created for Windows.

Flanium is made by joining two frameworks:

  1. Selenium - Selenium is a suite of tools for automating web browsers.
  2. 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]

Documentation can be found here.

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/.

chromeWeb.Navigate().GoToUrl("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:

WebEvents.Action.Click(chromeWeb,"//*[@id='ctl00_TopNavBar_Answers']");

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:

chromeWeb.Dispose();

And now we're done, our very first automation done easily.

Automatic Logging

All of the event libraries have built in logging for them, so you will see the results of the code in the Console Application.

Example: image

The logging no longer looks like in the example image, but the general idea is the same.

Product Compatible and additional computed target framework versions.
.NET net6.0-windows10.0.17763 is compatible.  net7.0-windows was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.2.6 420 9/5/2022
2.0.2.5 374 9/5/2022
1.1.0.2 373 8/18/2022
1.1.0.1 356 8/17/2022
1.0.5 375 8/16/2022