Table of Contents

Class SeleniumManager

Namespace
OpenQA.Selenium.Manager
Assembly
Selenium.WebDriver.dll

Manages automatic discovery and configuration of browser drivers.

public static class SeleniumManager
Inheritance
SeleniumManager
Inherited Members

Remarks

Warning: This is an experimental API that is subject to change in future versions.

Selenium Manager automatically locates or downloads the appropriate browser driver for the specified browser. It eliminates the need for manual driver management by:

  • Detecting the installed browser version
  • Downloading the matching driver binary if needed
  • Caching drivers for subsequent use
  • Providing paths to both driver and browser executables

The Selenium Manager binary is automatically included with the Selenium package. Set the SE_MANAGER_PATH environment variable to use a custom binary location.

Methods

DiscoverBrowserAsync(string, BrowserDiscoveryOptions?, CancellationToken)

Discovers the browser and driver paths for the specified browser.

public static Task<BrowserDiscoveryResult> DiscoverBrowserAsync(string name, BrowserDiscoveryOptions? options = null, CancellationToken cancellationToken = default)

Parameters

name string

The name of the browser (e.g., "chrome", "firefox", "edge").

options BrowserDiscoveryOptions

Optional discovery options to control browser and driver resolution.

cancellationToken CancellationToken

A token to cancel the asynchronous operation. When cancellation is requested, the Selenium Manager process is terminated.

Returns

Task<BrowserDiscoveryResult>

A Task<TResult> representing the asynchronous operation, containing a BrowserDiscoveryResult with the paths to the driver and browser executables.

Exceptions

ArgumentException

Thrown when name is null, empty, or whitespace.

WebDriverException

Thrown when Selenium Manager fails to locate or download the required binaries.

OperationCanceledException

Thrown when the operation is canceled via cancellationToken.