![]() |
VOOZH | about |
dotnet add package WebDriverManager --version 2.17.7
NuGet\Install-Package WebDriverManager -Version 2.17.7
<PackageReference Include="WebDriverManager" Version="2.17.7" />
<PackageVersion Include="WebDriverManager" Version="2.17.7" />Directory.Packages.props
<PackageReference Include="WebDriverManager" />Project file
paket add WebDriverManager --version 2.17.7
#r "nuget: WebDriverManager, 2.17.7"
#:package WebDriverManager@2.17.7
#addin nuget:?package=WebDriverManager&version=2.17.7Install as a Cake Addin
#tool nuget:?package=WebDriverManager&version=2.17.7Install as a Cake Tool
Info
Built-in manager was released by Selenium "Selenium Manager", which will automatically download the most suitable version and platform WebDriver executable file. So now, you can run applications that use Selenium and manipulates web browsers without this package.
This small library aimed to automate the Selenium WebDriver binaries management inside a .Net project.
If you have ever used Selenium WebDriver, you probably know that in order to use some browsers (for example Chrome) you need to download a binary which allows WebDriver to handle the browser. In addition, the absolute path to this binary must be set as part of the PATH environment variable or manually copied to build output folder (working directory).
This is quite annoying since it forces you to link directly this binary in your source code. In addition, you have to check manually when new versions of the binaries are released. This library comes to the rescue, performing in an automated way all this dirty job for you.
WebDriverManager is open source, released under the terms of MIT license.
WebDriverManager.Net can be downloaded from NuGet. Use the GUI or the following command in the Package Manager Console:
PM> Install-Package WebDriverManager
Target is netstandard2.0.
After installation you can let WebDriverManager.Net to do manage WebDriver binaries for your application/test. Take a look to this NUnit example which uses Chrome with Selenium WebDriver:
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using WebDriverManager;
using WebDriverManager.DriverConfigs.Impl;
namespace Test
{
[TestFixture]
public class Tests
{
private IWebDriver _webDriver;
[SetUp]
public void SetUp()
{
new DriverManager().SetUpDriver(new ChromeConfig());
_webDriver = new ChromeDriver();
}
[TearDown]
public void TearDown()
{
_webDriver.Quit();
}
[Test]
public void Test()
{
_webDriver.Navigate().GoToUrl("https://www.google.com");
Assert.True(_webDriver.Title.Contains("Google"));
}
}
}
Notice that simply adding new DriverManager().SetUpDriver(<config>) does magic for you:
So far, WebDriverManager supports Chrome, Microsoft Edge, Firefox(Marionette), Internet Explorer, Opera or PhantomJS configs (just change <config> to preferred config):
new ChromeConfig();
new EdgeConfig();
new FirefoxConfig();
new InternetExplorerConfig();
new OperaConfig();
new PhantomConfig();
You can use WebDriverManager in two ways:
new DriverManager().SetUpDriver(new <Driver>Config());
You can also specify version:
new DriverManager().SetUpDriver(new ChromeConfig(), "2.25")
Or architecture:
new DriverManager().SetUpDriver(new ChromeConfig(), "Latest", Architecture.X32)
Or version and architecture:
new DriverManager().SetUpDriver(new ChromeConfig(), "2.25", Architecture.X64)
Or you can specify to automatically download a driver matching the version of the browser that is installed in your machine (only for Chrome, Edge, Firefox and Internet Explorer):
new DriverManager().SetUpDriver(new ChromeConfig(), VersionResolveStrategy.MatchingBrowser);
new DriverManager().SetUpDriver(
"https://chromedriver.storage.googleapis.com/2.25/chromedriver_win32.zip",
Path.Combine(Directory.GetCurrentDirectory(), "chromedriver.exe")
);
public class TaobaoPhantomConfig : IDriverConfig
{
public string GetName()
{
return "TaobaoPhantom";
}
public string GetUrl32()
{
return "https://npm.taobao.org/mirrors/phantomjs/phantomjs-<version>-windows.zip";
}
public string GetUrl64()
{
return GetUrl32();
}
public string GetBinaryName()
{
return "phantomjs.exe";
}
public string GetLatestVersion()
{
using (var client = new WebClient())
{
var doc = new HtmlDocument();
var htmlCode = client.DownloadString("https://bitbucket.org/ariya/phantomjs/downloads");
doc.LoadHtml(htmlCode);
var itemList =
doc.DocumentNode.SelectNodes("//tr[@class='iterable-item']/td[@class='name']/a")
.Select(p => p.InnerText)
.ToList();
var version = itemList.FirstOrDefault()?.Split('-')[1];
return version;
}
}
}
...
new DriverManager().SetUpDriver(new TaobaoPhantomConfig());
public class CustomBinaryService : IBinaryService
{
public string SetupBinary(string url, string zipDestination, string binDestination, string binaryName)
{
...
// your implementation
...
}
}
public class CustomVariableService : IVariableService
{
public void SetupVariable(string path)
{
...
// your implementation
...
}
}
...
new DriverManager(new CustomBinaryService(), new CustomVariableService()).SetUpDriver(new FirefoxConfig());
public class TaobaoPhantomConfig : PhantomConfig
{
public override string GetName()
{
return "TaobaoPhantom";
}
public override string GetUrl32()
{
return "https://npm.taobao.org/mirrors/phantomjs/phantomjs-<version>-windows.zip";
}
}
...
new DriverManager().SetUpDriver(new TaobaoPhantomConfig());
new DriverManager().WithProxy(previouslyInitializedProxy).SetUpDriver(new ChromeConfig());
You can also set the environment variables HTTP_PROXY and/or HTTPS_PROXY to use a proxy when retrieving the drivers.
This does not require any changes in the setup of DriverManager in C#.
Thanks to the following companies for generously providing their services/products to help improve this project:
WebDriverManager.Net (Copyright © 2016-2026) is a personal project of Aliaksandr Rasolka licensed under MIT license. Comments, questions and suggestions are always very welcome!
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 is compatible. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on WebDriverManager:
| Package | Downloads |
|---|---|
|
Pangolin
A framework for declarative UI testing for ASP.NET apps. Browsers: All browsers can be used. With the possibility of automatic update to the latest version. |
|
|
Magenic.Maqs.Selenium
Magenic's automation quick start framework |
|
|
Aquality.Selenium
Wrapper over Selenium WebDriver for .NET |
|
|
JDI.UIWeb
Framework for Web UI Automation Testing |
|
|
CRZ.ViewModels
Package Description |
Showing the top 3 popular GitHub repositories that depend on WebDriverManager:
| Repository | Stars |
|---|---|
|
AutomateThePlanet/AutomateThePlanet-Learning-Series
Automate The Planet Series Source Code
|
|
|
featurist/coypu
Intuitive, robust browser automation for .Net
|
|
|
junkai-li/NetCoreKevin
🤖基于.NET搭建的企业级中台AI知识库智能体开源架构:Skills技能管理、AI-Qdrant知识库、知识库重排模型、AI联网搜索、多智能体协同、聊天记录压缩策略、智能体权限管控、AgentFramework、RAG检索增强、本地Ollama AI模型调用、智能体技能可控加载、领域事件、一库多租户、Log4、Jwt、CAP、SignalR、Mcp、Ioc、Hangfire、RabbitMQ、Xunit、前端(Vue + Ant Design)
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.17.7 | 195,059 | 3/5/2026 |
| 2.17.6 | 3,060,980 | 7/16/2025 |
| 2.17.5 | 1,553,049 | 12/18/2024 |
| 2.17.4 | 1,622,889 | 6/22/2024 |
| 2.17.3 | 22,764 | 6/18/2024 |
| 2.17.2 | 1,020,153 | 2/17/2024 |
| 2.17.1 | 3,316,568 | 8/9/2023 |
| 2.17.0 | 575,872 | 7/31/2023 |
| 2.16.3 | 295,183 | 6/26/2023 |
| 2.16.2 | 1,262,924 | 12/5/2022 |
| 2.16.1 | 972,395 | 11/11/2022 |
| 2.16.0 | 324,695 | 9/16/2022 |
| 2.15.0 | 242,321 | 8/16/2022 |
| 2.14.1 | 321,337 | 6/30/2022 |
| 2.14.0 | 15,081 | 6/28/2022 |
| 2.13.0 | 466,205 | 5/22/2022 |
| 2.12.4 | 373,670 | 4/5/2022 |
| 2.12.3 | 1,204,230 | 12/14/2021 |
| 2.12.2 | 410,303 | 10/26/2021 |
| 2.12.1 | 124,809 | 10/5/2021 |
Fix chrome exact version driver download