Selenium.WebDriver.ChromeDriver 2.20.0

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

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

NuGet package - Selenium WebDriver ChromeDriver

NuGet Package NuGet Package NuGet Package

What's this?

This NuGet package installs Chrome Driver (Win32, macOS, macOS arm64, and Linux64) for Selenium WebDriver into your Unit Test Project.

"chromedriver(.exe)" does not appear in Solution Explorer, but it is copied to the output folder from the package source folder when the build process.

NuGet package restoring ready, and no need to commit "chromedriver(.exe)" binary into source code control repository.

How to install?

For example, at the package manager console on Visual Studio, enter the following command.

If you are using Chrome version 106:

PM> Install-Package Selenium.WebDriver.ChromeDriver -Version 106.0.5249.6100

If you are using Chrome version 105:

PM> Install-Package Selenium.WebDriver.ChromeDriver -Version 105.0.5195.5200

If you are using Chrome version 104:

PM> Install-Package Selenium.WebDriver.ChromeDriver -Version 104.0.5112.7900

To learn what version of ChromeDriver you need to use, please see also the following page:

https://chromedriver.chromium.org/downloads/version-selection

Cross-platform building and publishing

By default - it depends on the OS running the build process

By default, the platform type of the web driver file copied to the output folder depends on the OS running the build process.

  • When you build the project which references the NuGet package of chromedriver on Windows OS, win32 version of chromedriver will be copied to the output folder.
  • When you build it on macOS on Intel CPU hardware, macOS x64 version of chromedriver will be copied to the output folder.
  • When you build it on macOS on Apple CPU hardware, macOS Arm64 version of chromedriver will be copied to the output folder.
  • When you build it on any Linux distributions, Linux x64 version of chromedriver will be copied to the output folder.

Method 1 - Specify "Runtime Identifier"

When you specify the "Runtime Identifier (RID)" explicitly, the platform type of the driver file is the same to the RID which you specified. (it doesn't depends on the which OS to use for build process.)

You can specify RID as a MSBuild property in a project file,

<PropertyGroup>
  <RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>

or, as a command-line -r option for dotnet build command.

> dotnet build -r:osx.10.12-x64
  • When the RID that starts with "win" is specified, win32 version of chromedriver will be copied to the output folder.
  • When the RID that starts with "osx" and ends with "x64" is specified, macOS x64 version of chromedriver will be copied to the output folder.
  • When the RID that starts with "osx" and ends with "arm64" is specified, macOS Arm64 version of chromedriver will be copied to the output folder.
  • When the RID that starts with "linux" is specified, Linux x64 version of chromedriver will be copied to the output folder.

If you specify another pattern of RID like "ubuntu.18.04-x64", the platform type of the web driver file which will be copied to the output folder depends on the OS running the build process. (default behavior.)

Method 2 - Specify "WebDriverPlatform" msbuild property

You can control which platform version of chromedriver will be copied by specifying "WebDriverPlatform" MSBuild property.

"WebDriverPlatform" MSBuild property can take one of the following values:

  • "win32"
  • "mac64"
  • "mac64arm"
  • "linux64"

You can specify "WebDriverPlatform" MSBuild property in a project file,

<PropertyGroup>
  <WebDriverPlatform>win32</WebDriverPlatform>
</PropertyGroup>

or, command-line -p option for dotnet build command.

> dotnet build -p:WebDriverPlatform=mac64

The specifying "WebDriverPlatform" MSBuild property is the highest priority method to control which platform version of the chromedriver will be copied.

If you run the following command on Windows OS,

> dotnet build -r:ubuntu.18.04-x64 -p:WebDriverPlatform=mac64

The driver file of macOS x64 version will be copied to the output folder.

How to include the driver file into published files?

"chromedriver(.exe)" isn't included in published files on default configuration. This behavior is by design.

If you want to include "chromedriver(.exe)" into published files, please define _PUBLISH_CHROMEDRIVER compilation symbol.

define _PUBLISH_CHROMEDRIVER compilation symbol

Another way, you can define PublishChromeDriver property with value is "true" in MSBuild file (.csproj, .vbproj, etc...) to publish the driver file instead of define compilation symbol.

  <Project ...>
    ...
    <PropertyGroup>
      ...
      <PublishChromeDriver>true</PublishChromeDriver>
      ...
    </PropertyGroup>
...
</Project>

You can also define PublishChromeDriver property from the command line -p option for dotnet publish command.

> dotnet publish -p:PublishChromeDriver=true
Note

PublishChromeDriver MSBuild property always override the condition of define _PUBLISH_CHROMEDRIVER compilation symbol or not. If you define PublishChromeDriver MSBuild property with false, then the driver file isn't included in publish files whenever define _PUBLISH_CHROMEDRIVER compilation symbol or not.

Appendix

The numbering of the package version

The rule of the version number of this package is:

chromedriver version MAJOR.MINOR.BUILD.PATCH + package version (2 digit)

For example, 2nd package release for the chromedriver ver.1.2.3.4, the package version is 1.2.3.4 + 021.2.3.402.

Sometime multiple packages for the same chromedriver version may be released by following example reasons.

  • Packaging miss. (the package included invalid version of the driver files)
  • Fixing bug of the build script, or improving the build script.

Where is chromedriver.exe saved to?

chromedriver(.exe) exists at
" {solution folder} /packages/Selenium.WebDriver.ChromeDriver. {ver} /driver/ {platform}"
folder.

 {Solution folder}/
  +-- packages/
  |   +-- Selenium.WebDriver.ChromeDriver.{version}/
  |       +-- driver/
  |       |   +-- win32
  |       |       +-- chromedriver.exe
  |       |   +-- mac64
  |       |       +-- chromedriver
  |       |   +-- mac64arm
  |       |       +-- chromedriver
  |       |   +-- linux64
  |       |       +-- chromedriver
  |       +-- build/
  +-- {project folder}/
      +-- bin/
          +-- Debug/
          |   +-- chromedriver(.exe) (copy from above by build process)
          +-- Release/
              +-- chromedriver(.exe) (copy from above by build process)

And package installer configure MSBuild task such as .csproj to copy chromedriver(.exe) into the output folder during the build process.

License

The build script (.targets file) in this NuGet package is licensed under The Unlicense.

The binary files of ChromeDriver are licensed under the BSD-3-Clause.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (44)

Showing the top 5 popular GitHub repositories that depend on Selenium.WebDriver.ChromeDriver:

Repository Stars
duplicati/duplicati
Store securely encrypted backups in the cloud!
Sonarr/Sonarr
Smart PVR for newsgroup and bittorrent users.
Radarr/Radarr
Movie organizer/manager for usenet and torrent users.
btcpayserver/btcpayserver
Accept Bitcoin payments. Free, open-source & self-hosted, Bitcoin payment processor.
mono/SkiaSharp
SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
Version Downloads Last updated
2.20.0 11,263 10/9/2015
2.19.0 5,678 9/6/2015
2.18.0 5,099 8/22/2015
2.17.0 1,569 8/12/2015
2.16.0 5,277 6/27/2015
2.15.0 14,257 4/1/2015
2.14.0.1-beta 195 3/6/2015
2.14.0 8,096 3/3/2015
2.13.0 9,775 1/6/2015
2.12.0 13,642 10/30/2014
2.10.0.1-beta2 1,123 8/14/2014
2.10.0.1-beta 82 8/14/2014
2.10.0 16,270 5/8/2014
2.9.0.1 3,902 4/7/2014
2.9.0.1-beta3 86 4/5/2014
2.9.0.1-beta2 87 4/3/2014
2.9.0 1,168 3/27/2014
2.8.0 4,753 1/24/2014
2.3.0 6,033 9/7/2013
2.2.0 207 8/28/2013

v.2.20.0.0
     - Chrome Driver 2.19 release
     v.2.19.0.0
     - Chrome Driver 2.19 release
     v.2.18.0.0
     - Chrome Driver 2.18 release
     v.2.17.0.0
     - Chrome Driver 2.17 release
     v.2.16.0.0
     - Chrome Driver 2.16 release
     v.2.15.0.0
     - Chrome Driver 2.15 release
     v.2.14.0.1
     - Include chromedriver.exe in this package, no downloading during package instllation.
     v.2.14.0.0
     - Chrome Driver 2.14 release
     v.2.13.0.0
     - Chrome Driver 2.13 release
     v.2.12.0.0
     - Chrome Driver 2.12 release
     v.2.10.0.1
     - Fix: Installing this package was fail when .csproj file and packages folder are in a same folder.
     v.2.10
     - Chrome Driver 2.10 release
     v.2.9.0.1
     - HTTP proxy settings are available now.(1. HTTP_PROXY environment variable, 2. NuGet configuration)
     - Fix: Occur exception at Add-Type in init.ps1 when installing the package.