Selenium.WebDriver.NetCoreWebDriverFactory 2.2.0

There is a newer version of this package available.
See the version list below for details.
Install-Package Selenium.WebDriver.NetCoreWebDriverFactory -Version 2.2.0
dotnet add package Selenium.WebDriver.NetCoreWebDriverFactory --version 2.2.0
<PackageReference Include="Selenium.WebDriver.NetCoreWebDriverFactory" Version="2.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Selenium.WebDriver.NetCoreWebDriverFactory --version 2.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Selenium.WebDriver.NetCoreWebDriverFactory, 2.2.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. 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=2.2.0

// Install Selenium.WebDriver.NetCoreWebDriverFactory as a Cake Tool
#tool nuget:?package=Selenium.WebDriver.NetCoreWebDriverFactory&version=2.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

A library to ease the creation of Selenium WebDriver instances in .net Core projects.

Usage
Instantiate a WebDriverFactory from a .NET Core project:
IWebDriverFactory webDriverFactory =  new DefaultWebDriverFactory(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), {{yourGridUri}});

Use the alternative Windows1803WebDriverFactory implementation for Windows 10 version 1803 and earlier.
IWebDriverFactory webDriverFactory =  new Windows1803WebDriverFactory(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), {{yourGridUri}});

This is not intended for .NET Framework (as it is really not required) but if you would like to use it in a Framework project use:
IWebDriverFactory webDriverFactory =  new FrameworkWebDriverFactory({{yourGridUri}});

Then to use it
IWebDriver localWebDriver = webDriverFactory.GetLocalWebDriver(Browser.xxxx);
or
IWebDriver remoteWebDriver = webDriverFactory.GetRemoteWebDriver(Browser.xxxx, PlatformType.xxxx);

Supported Browsers:
Chrome
Firefox
Edge (Windows 10)
Internet Explorer 11 (Windows Platforms)
Safari (MacOS)

Platforms:
Windows (PlatformType.Windows)
Linux        (PlatformType.Linux)
MacOS     (PlatformType.Mac)

Tested and working on Windows 10, Linux (Ubuntu 18.04) and MacOS Mojave

The repository at
https://github.com/AlexanderOnTesting/NetCoreWebDriverFactory
contains test projects for Windows, Linux and MacOS. These can be used to test your setup and demonstrate the options available.

The supporting package Selenium.WebDriver.WebDriverFactoryNunitConfig provides easy test configuration options if using Nunit 3 for your tests.

NuGet packages (1)

Showing the top 1 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.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.0 5,097 6/20/2019
2.3.0 965 3/10/2019
2.2.0 349 3/1/2019
2.1.0 413 1/3/2019
2.0.0 371 12/19/2018
1.0.1 419 11/2/2018
1.0.0 457 10/11/2018
0.9.6 420 10/10/2018

v2.2.0
Introduction of IWebDriverConfiguration and addition of iDisposable on instances.

Warning: v2.2.x will be the final feature release of v2.
v3.x.x will require an additonal (optional) parameter on many interface methods to support custom browser sizes.
This should only be a breaking change if you are implementing the interfaces, or extending my classes:
If you are only consuming the interfaces, the version change will be safe.

v2.1.0
Addition of a generalised GetWebDriver method for both local and remote webdrivers.
IWebDriver GetWebDriver(Browser browser, WindowSize windowSize = WindowSize.Hd, bool isLocal = true,
           PlatformType platformType = PlatformType.Any, bool headless = false)

And a WebDriverManager interface and implementation that uses it.

v2.0.0 final
Significant refactoring from v1.0.1 for simplified usage:
1) IWebDriverFactory:
       IWebDriver GetRemoteWebDriver(Browser browser, PlatformType platformType = PlatformType.Any, WindowSize windowSize = WindowSize.Hd, bool headless = false);
       IWebDriver GetRemoteWebDriver(DriverOptions options, WindowSize windowSize = WindowSize.Hd);

       IWebDriver GetLocalWebDriver(Browser browser, WindowSize windowSize = WindowSize.Hd, bool headless = false);
       IWebDriver GetLocalWebDriver(ChromeOptions options, WindowSize windowSize = WindowSize.Hd);
       IWebDriver GetLocalWebDriver(FirefoxOptions options, WindowSize windowSize = WindowSize.Hd);
       IWebDriver GetLocalWebDriver(EdgeOptions options, WindowSize windowSize = WindowSize.Hd);
       IWebDriver GetLocalWebDriver(InternetExplorerOptions options, WindowSize windowSize = WindowSize.Hd);
       IWebDriver GetLocalWebDriver(SafariOptions options, WindowSize windowSize = WindowSize.Hd);

DefaultWebDriverFactory no longer has a default constructor and must be instantiated using
       public DefaultWebDriverFactory(string installedDriverPath, Uri gridUri = null, IDriverOptionsFactory driverOptionsFactory = null)

2) IDriverOptionsFactory:
       T GetLocalDriverOptions<T>(bool headless = false) where T : DriverOptions;
       T GetRemoteDriverOptions<T>(PlatformType platformType) where T : DriverOptions;

In addition, DefaultDriverOptionsFactory exposes a new constructor:
      public DefaultDriverOptionsFactory(Dictionary<Type, DriverOptions> driverOptionsDictionary)
to enable the use of your own standard DriverOptions choices.