Class SeleniumManager
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
namestringThe name of the browser (e.g., "chrome", "firefox", "edge").
optionsBrowserDiscoveryOptionsOptional discovery options to control browser and driver resolution.
cancellationTokenCancellationTokenA 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
nameis 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.