Lyo.Web.Automation.Selenium
1.0.1
dotnet add package Lyo.Web.Automation.Selenium --version 1.0.1
NuGet\Install-Package Lyo.Web.Automation.Selenium -Version 1.0.1
<PackageReference Include="Lyo.Web.Automation.Selenium" Version="1.0.1" />
<PackageVersion Include="Lyo.Web.Automation.Selenium" Version="1.0.1" />
<PackageReference Include="Lyo.Web.Automation.Selenium" />
paket add Lyo.Web.Automation.Selenium --version 1.0.1
#r "nuget: Lyo.Web.Automation.Selenium, 1.0.1"
#:package Lyo.Web.Automation.Selenium@1.0.1
#addin nuget:?package=Lyo.Web.Automation.Selenium&version=1.0.1
#tool nuget:?package=Lyo.Web.Automation.Selenium&version=1.0.1
Lyo.Web.Automation.Selenium
Selenium WebDriver implementation of the engine-agnostic Lyo.Web.Automation abstractions: browser launch (Chrome / Edge / Firefox / Safari + Selenium Grid), session isolation, polling, tab/frame/dialog/keyboard helpers, typed element controls, automation plans, and DI registration.
Examples
Quick start
services.AddSeleniumBrowserServiceFromConfiguration(builder.Configuration);
// later, per-operation:
var service = sp.GetRequiredService<ISeleniumBrowserService>();
using var session = service.CreateSession();
await session.StartBrowserAsync();
await session.Browser.NavigateAsync("https://example.com");
Surface — Browser (Browser/)
SeleniumBrowser— concreteIWebAutomationBrowser(PageBase); composesSeleniumBrowserTabs,BrowserAlerts,BrowserKeyboard,FrameNavigator,SeleniumPolling.SeleniumWebAutomationElement—IWebAutomationElementadapter on top ofIWebElement.TabManager/SeleniumBrowserTabs— engine-native and abstract-tab management.BrowserCookieExtensions— typed cookie helpers.BrowserUrlRedaction— query-string/fragment redaction used in logs whenMaskSensitiveUrlsInLogsis set.
Surface — Service (Service/)
ISeleniumBrowserService— singleton factory:CreateSession(SeleniumSessionOptions?),ActiveSessionCount,Dispose.ISeleniumBrowserSession— scoped session (Browser,Tabs, dispose to release WebDriver resources).SeleniumExecutionContext/SeleniumExecutionContextFactory— wiring used by the automation runners.SeleniumMetricTags— metric-tag constants.
Surface — Configuration (Configuration/)
SeleniumBrowserOptions holds application-wide defaults; SeleniumSessionOptions is the per-session subclass passed to
CreateSession. Configuration section: "SeleniumBrowserOptions".
| Property | Default | Notes |
|---|---|---|
BrowserKind |
Chrome |
SeleniumBrowserKind: Chrome, Edge, Firefox, Safari. |
Headless |
false |
Headless mode where supported. |
RemoteWebDriverUri |
null |
When set, drives RemoteWebDriver against a Selenium Grid / standalone server. |
UserAgents |
4 desktop UAs | Round-robined for stealth. |
WebDriverArguments |
disable-infobars, disable-extensions, disable-gpu, disable-dev-shm-usage, no-sandbox |
Use AddArgument(key, value?) to append key=value (or bare key) entries. |
StartupScripts |
[] |
JS injected via CDP Page.addScriptToEvaluateOnNewDocument (Chrome/Edge only) — bypass bot-detection traps. |
EnablePerformanceLogging |
true |
Required for CDP-based network observation in IWebAutomationNavigator.NavigateAsync. Disable on sites that detect CDP, then provide a JS interception script in StartupScripts. |
BrowserWindowWidth/Height |
1280 × 1024 |
Initial window size. |
PageLoadTimeoutSeconds |
30 |
Page-load timeout. |
ImplicitWaitSeconds |
10 |
WebDriver implicit wait. |
ScriptTimeoutSeconds |
30 |
Async-script timeout. |
SeleniumMaxWaitSeconds |
15 |
Wrapper for explicit waits. |
EnableMetrics |
true |
Emit IMetrics instrumentation when an IMetrics is registered. |
MaskSensitiveUrlsInLogs |
false |
Strip query/fragment in log lines. |
ServiceRootDirectory |
{tmp}/lyo-selenium |
Each session creates session-{id}/ with browser-profile/, artifacts/, downloads/. |
BrowserUserDataDirectory / DownloadDirectory / ArtifactsDirectory |
derived under session dir | Override individually if needed. |
PollingMaxAttempts / PollingDelayBetweenAttempts |
5 / 500 ms |
Outer-loop control for SeleniumBrowser.PollFor. |
Clone() |
— | Deep copy used to derive session-specific options. |
SeleniumBrowserOptionsBuilder is a fluent builder over the options record.
Surface — Typed element controls (Controls/)
Wrappers over IWebElement for typed interactions: WebElementControl (base), InputControl (Value, SendKeys), TextAreaControl, ButtonControl, LinkControl, SelectControl, CheckboxControl. Resolve via SeleniumBrowser element APIs and hold them across explicit waits.
Surface — WebDriver / Automation (WebDriver/, Automation/ElementLocatorMapping.cs)
Driver-factory helpers (Chrome / Edge / Firefox / Safari + Remote) and the locator mapping that lets Lyo.Web.Automation JSON automation plans target Selenium-style locators.
DI registration (Service/Extensions.cs)
All registrations are extension methods on IServiceCollection:
| Method | Registers |
|---|---|
AddSeleniumBrowser(Action<SeleniumBrowserOptions>?) |
Singleton SeleniumBrowserOptions, scoped SeleniumBrowser for direct injection (legacy style). |
AddSeleniumBrowser(Action<SeleniumBrowserOptionsBuilder>) |
Same, with options built fluently. |
AddSeleniumBrowser(SeleniumBrowserOptions) |
Same, with explicit options instance. |
AddSeleniumBrowserService(Action<SeleniumBrowserOptions>?) |
Above + singleton ISeleniumBrowserService (use this for session-based usage via CreateSession). |
AddSeleniumBrowserService(Action<SeleniumBrowserOptionsBuilder>) |
Same, fluent options. |
AddSeleniumBrowserService(SeleniumBrowserOptions) |
Same, explicit options. |
AddSeleniumBrowserServiceFromConfiguration(IConfiguration, sectionName?) |
Binds options from configuration (default section "SeleniumBrowserOptions"). |
Dependencies
Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).
Lyo.IO.Temp— (direct, lyo)Lyo.Web.Automation— (direct, lyo)Microsoft.Extensions.DependencyInjection.Abstractions10.0.5— (direct, microsoft)Microsoft.Extensions.Logging.Abstractions10.0.5— (direct, microsoft)Microsoft.Extensions.Options.ConfigurationExtensions10.0.5— (direct, microsoft)Selenium.Support4.46.0— (direct, third-party)Selenium.WebDriver4.46.0— (direct, third-party)System.Text.Json10.0.5— (direct, microsoft, netstandard2.0)Lyo.Common— (transitive, lyo)Lyo.Exceptions— (transitive, lyo)Lyo.Formatter— (transitive, lyo)Lyo.Metrics— (transitive, lyo)Microsoft.Bcl.AsyncInterfaces10.0.5— (transitive, microsoft, netstandard2.0)Microsoft.Extensions.Configuration.Binder10.0.5— (transitive, microsoft)Microsoft.Extensions.Hosting.Abstractions10.0.5— (transitive, microsoft)SmartFormat.NET3.6.1— (transitive, third-party)System.Memory4.6.3— (transitive, microsoft, netstandard2.0)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Lyo.IO.Temp (>= 1.0.1)
- Lyo.Web.Automation (>= 1.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.5)
- Selenium.Support (>= 4.46.0)
- Selenium.WebDriver (>= 4.46.0)
- System.Text.Json (>= 10.0.5)
-
net10.0
- Lyo.IO.Temp (>= 1.0.1)
- Lyo.Web.Automation (>= 1.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.5)
- Selenium.Support (>= 4.46.0)
- Selenium.WebDriver (>= 4.46.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.