Selenium.WebDriver.NetCoreWebDriverFactory 4.1.0

dotnet add package Selenium.WebDriver.NetCoreWebDriverFactory --version 4.1.0                
NuGet\Install-Package Selenium.WebDriver.NetCoreWebDriverFactory -Version 4.1.0                
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="Selenium.WebDriver.NetCoreWebDriverFactory" Version="4.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Selenium.WebDriver.NetCoreWebDriverFactory --version 4.1.0                
#r "nuget: Selenium.WebDriver.NetCoreWebDriverFactory, 4.1.0"                
#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 Selenium.WebDriver.NetCoreWebDriverFactory as a Cake Addin
#addin nuget:?package=Selenium.WebDriver.NetCoreWebDriverFactory&version=4.1.0

// Install Selenium.WebDriver.NetCoreWebDriverFactory as a Cake Tool
#tool nuget:?package=Selenium.WebDriver.NetCoreWebDriverFactory&version=4.1.0                

Selenium.WebDriver.NetCoreWebDriverFactory

Version 4.x

An extensible library to ease the configuration and launching of Selenium WebDriver instances in .net / .net Core / .net Framework projects. Supports browser instances run locally or on a Selenium grid v4.

Supported Browsers:

  • Chrome
  • Firefox
  • Edge
  • Internet Explorer 11 (Windows Platforms remotely and locally including Edge Internet Explorer mode)
  • Safari (MacOS)

Platforms:

  • Windows (PlatformType.Windows)
  • Linux (PlatformType.Linux)
  • MacOS (PlatformType.Mac)

Tested and working on Windows 10/11, Linux (Ubuntu 22.04) and macOS Monterey

NUnit3 auto configuration library available

Selenium.WebDriver.WebDriverFactoryNunitConfig provides additional code to pull the required configuration from *.runsettings files including the option to override with local configuration files.

This can be used to completely separate WebDriver configuration from your test code.

Designed for Dependency Injection

ServiceCollectionFactory.cs includes static methods that provide a configured Microsoft.Extensions.DependencyInjection.IServiceCollection for use in your project although you may prefer to use the code as inspiration for your own implementation / module.

e.g. NUnit3 example

    private IWebDriverFactory webDriverFactory;
    
    [OneTimeSetUp]
    public void Setup()
    {
        IServiceCollection serviceCollection = ServiceCollectionFactory.GetDefaultServiceCollection();
        IServiceProvider provider = serviceCollection.BuildServiceProvider();
        webDriverFactory = provider.GetRequiredService<IWebDriverFactory>();
    }

Fluent Browser configuration including window size

WebDriverConfigurationBuilder.cs provides a fluent interface to generate an IWebDriverConfiguration.cs defining the characteristics of the WebDriver instance you desire.

e.g.

IWebDriverConfiguration configuration = WebDriverConfigurationBuilder.Start()
                             .WithBrowser(Browser.Firefox)
                             .RunHeadless()
                             .RunRemotelyOn(new Uri("http://localhost:4444"))
                             .WithPlatformType(PlatformType.Mac)
                             .WithLanguageCulture(new CultureInfo("es-Es"))
                             .WithWindowSize(WindowSize.Fhd)
                             .Build();

WebDriver launching using the WebDriverFactory

IWebDriver driver = webDriverFactory.GetWebDriver(configuration);

Optional WebDriver instance management

To generate and reuse one or more WebDriver instances of a single configuration use a WebDriverManager.cs

IWebDriverManager webDriverManager = new WebDriverManager(webDriverFactory, configuration)

IWebDriver driver = webDriverManager.Get();

Repeated calls to webDriverManager.Get() will return the same singleton IWebDriver instance until it is closed by calling webDriverManager.Quit().

Limited logging support available using LibLog

Guidance on unsupported configurations

The library attempts to provide informative exceptions where the requested WebDriver does not support the requested options. As supported features do change, these are not guaranteed to remain correct.

Extensible

All services are defined as interfaces so you can provide alternative or additional implementations if needed.

  • The Browser.cs Enum in particular has been populated with many potential additional options that you can provide your own implementations to support.
  • The configurations also support custom window sizes if the pre-defined options are not enough.
Product 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. 
.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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Selenium.WebDriver.NetCoreWebDriverFactory:

Package Downloads
Selenium.WebDriver.WebDriverFactoryNunitConfig

Pick up NetCoreWebDriverFactory configuration for Nunit 3 test projects from runsettings files and with local file override options. See project URL for details.

Kwolo.MaseratiConnect

.net library to retrieve data about a car from Maserati Connect

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.1.0 11,214 5/29/2022
4.0.0 1,558 4/23/2022
4.0.0-RC3 895 4/21/2022
4.0.0-RC2 866 4/20/2022
4.0.0-RC1 848 4/4/2022
4.0.0-beta7 909 2/18/2022
4.0.0-beta6 870 2/13/2022
4.0.0-beta5 866 2/9/2022
4.0.0-beta4 832 2/7/2022
4.0.0-beta30 806 4/4/2022
4.0.0-beta3 900 2/6/2022
4.0.0-beta2 919 2/5/2022
4.0.0-beta12 854 2/21/2022
4.0.0-beta 905 2/5/2022
3.0.0 30,868 6/20/2019
2.3.0 2,200 3/10/2019
2.2.0 1,598 3/1/2019
2.1.0 1,479 1/3/2019
2.0.0 1,452 12/19/2018
1.0.1 1,579 11/2/2018
1.0.0 1,555 10/11/2018
0.9.6 1,576 10/10/2018

v4.1.0
       Added Mutability to the WebDriverConfiguration implementation
       Correctly use the GridUri passed in in an IWebDriverConfiguration over the factory default
       v4.0.0
       Added support for:
       Selenium Webdriver v4.x and Grid 4.x
       Chromium Edge on Windows, Linux and MacOs
       Internet Explorer Mode testing in Edge on Local Windows
       Requesting a browser with a given language culture where supported