Selenium PageFactory deprecated for .NET Core

See alternate implementation here.

accessing configuration in test projects

Accessing configuration and using dependency injection in Test Projects

building from source

References are in /eng, check building from source.

endpoint configuration

Specify URLs using ASPNETCORE_URLS environment variable or --urls command-line argument.

installing dotnet core sdk via powershell

The following will install both the sdk & runtime for a specific version:

# install dotnet core sdk
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -useb '' -OutFile dotnet-install.ps1
.\dotnet-install.ps1 -Version 2.2.203 -InstallDir 'C:\Program Files\dotnet'

To do the same but from a nightly (master) use --Channel master.

.\dotnet-install.ps1 -Channel master -InstallDir 'C:\Program Files\dotnet'

Installing the runtime only

.\dotnet-install.ps1 -Version 3.0.0-preview9-19410-12 -Runtime dotnet -InstallDir 'C:\Program Files\dotnet'

More info on dotnet-install.ps1.

blocking urls in selenium

Sometimes we want to block specific URLs from loading, for example Google Analytics so we don’t artificially inflate our statistics.

readonly string[] _blockUrls = new [] {

public ChromeDriver GetDriver() 
    var options = new ChromeOptions();
    var rules = string.Join(',', _blockUrls.Select(r => $"MAP {r}"));
    return new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), options);