{"id":19380350,"url":"https://github.com/atata-framework/atata-webdriversetup","last_synced_at":"2025-04-23T19:33:34.214Z","repository":{"id":48063339,"uuid":"335195301","full_name":"atata-framework/atata-webdriversetup","owner":"atata-framework","description":"Sets up browser drivers for Selenium WebDriver","archived":false,"fork":false,"pushed_at":"2025-04-08T20:53:12.000Z","size":307,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-10T04:34:45.423Z","etag":null,"topics":["atata","browser-drivers","chromedriver","edgedriver","geckodriver","internetexplorerdriver","operadriver","selenium","webdriver"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atata-framework.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"open_collective":"atata"}},"created_at":"2021-02-02T06:47:35.000Z","updated_at":"2025-04-08T20:29:58.000Z","dependencies_parsed_at":"2023-12-15T22:03:55.880Z","dependency_job_id":"2379eaa8-8ec0-4d81-b408-98469673448f","html_url":"https://github.com/atata-framework/atata-webdriversetup","commit_stats":{"total_commits":209,"total_committers":1,"mean_commits":209.0,"dds":0.0,"last_synced_commit":"cb19418e9a771a7817f8fa3544bfa6d8312139c3"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atata-framework%2Fatata-webdriversetup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atata-framework%2Fatata-webdriversetup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atata-framework%2Fatata-webdriversetup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atata-framework%2Fatata-webdriversetup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atata-framework","download_url":"https://codeload.github.com/atata-framework/atata-webdriversetup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249565239,"owners_count":21292427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atata","browser-drivers","chromedriver","edgedriver","geckodriver","internetexplorerdriver","operadriver","selenium","webdriver"],"created_at":"2024-11-10T09:13:41.944Z","updated_at":"2025-04-23T19:33:34.196Z","avatar_url":"https://github.com/atata-framework.png","language":"C#","funding_links":["https://opencollective.com/atata"],"categories":[],"sub_categories":[],"readme":"# Atata.WebDriverSetup\n\n[![NuGet](http://img.shields.io/nuget/v/Atata.WebDriverSetup.svg?style=flat)](https://www.nuget.org/packages/Atata.WebDriverSetup/)\n[![GitHub release](https://img.shields.io/github/release/atata-framework/atata-webdriversetup.svg)](https://github.com/atata-framework/atata-webdriversetup/releases)\n[![Build status](https://dev.azure.com/atata-framework/atata-webdriversetup/_apis/build/status/atata-webdriversetup-ci?branchName=main)](https://dev.azure.com/atata-framework/atata-webdriversetup/_build/latest?definitionId=39\u0026branchName=main)\n[![Atata Templates](https://img.shields.io/badge/get-Atata_Templates-green.svg?color=4BC21F)](https://marketplace.visualstudio.com/items?itemName=YevgeniyShunevych.AtataTemplates)\\\n[![Slack](https://img.shields.io/badge/join-Slack-green.svg?colorB=4EB898)](https://join.slack.com/t/atata-framework/shared_invite/zt-5j3lyln7-WD1ZtMDzXBhPm0yXLDBzbA)\n[![Atata docs](https://img.shields.io/badge/docs-Atata_Framework-orange.svg)](https://atata.io)\n[![Twitter](https://img.shields.io/badge/follow-@AtataFramework-blue.svg)](https://twitter.com/AtataFramework)\n\n**Atata.WebDriverSetup** is a .NET library that sets up browser drivers for Selenium WebDriver,\ne.g. `chromedriver`, `geckodriver`, etc.\nBasically, it provides functionality similar to Java `WebDriverManager`.\n\n*The package targets .NET Standard 2.0, which supports .NET 5+, .NET Framework 4.6.1+ and .NET Core/Standard 2.0+.*\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Set Up Version Corresponding to Locally Installed Browser Version](#set-up-version-corresponding-to-locally-installed-browser-version)\n  - [Set Up Latest Version](#set-up-latest-version)\n  - [Set Up Specific Version](#set-up-specific-version)\n  - [Set Up Version Corresponding to Specific Browser Version](#set-up-version-corresponding-to-specific-browser-version)\n- [DriverSetup Members](#driversetup-members)\n  - [DriverSetup Properties](#driversetup-properties)\n  - [DriverSetup Methods](#driversetup-methods)\n- [Configuration](#configuration)\n  - [Global Configuration](#global-configuration)\n  - [Driver-Specific Configuration](#driver-specific-configuration)\n  - [Configuration Methods](#configuration-methods)\n  - [Handle HTTPS Certificate Errors](#handle-https-certificate-errors)\n- [BrowserDetector](#browserdetector)\n  - [BrowserDetector Methods](#browserdetector-methods)\n  - [BrowserDetector Usage](#browserdetector-usage)\n- [Feedback](#feedback)\n- [SemVer](#semver)\n- [License](#license)\n\n## Features\n\n- Sets up drivers for browsers: Chrome, Firefox, Edge, Internet Explorer and Opera.\n- Supports Windows, Linux and macOS platforms.\n- Can download latest or specific driver versions.\n- Can auto-detect locally installed browser version and download corresponding driver version.\n- Caches the used driver versions.\n- After a driver is set up, adds the driver path to environment \"PATH\" variable, which is consumed by WebDriver.\n\n## Installation\n\nInstall [`Atata.WebDriverSetup`](https://www.nuget.org/packages/Atata.WebDriverSetup/) NuGet package.\n\n- Package Manager:\n  ```\n  Install-Package Atata.WebDriverSetup\n  ```\n\n- .NET CLI:\n  ```\n  dotnet add package Atata.WebDriverSetup\n  ```\n\nThe package depends on:\n\n- [`Microsoft.Win32.Registry`](https://www.nuget.org/packages/Microsoft.Win32.Registry/) - is used to detect locally installed browser version through Windows Registry.\n- [`Atata.Cli`](https://www.nuget.org/packages/Atata.Cli/) - is used to detect locally installed browser version through CLI on Linux and macOS.\n- [`System.Text.Json`](https://www.nuget.org/packages/System.Text.Json/) - is used to read JSON HTTP responses.\n\n## Usage\n\nThe main class is `DriverSetup`.\nThe recommended place to perform driver(s) setup is a global set up method.\n\nNUnit example:\n\n```cs\n[SetUpFixture]\npublic class SetUpFixture\n{\n    [OneTimeSetUp]\n    public void SetUp()\n    {\n        DriverSetup.AutoSetUp(BrowserNames.Chrome);\n    }\n}\n```\n\nAfter a driver is set up, the driver path is added to environment \"PATH\" variable,\nwhich is read by WebDriver's DriverService classes.\n\n```cs\nChromeDriver chromeDriver = new ChromeDriver();\n```\n\n### Set Up Version Corresponding to Locally Installed Browser Version\n\n1. Configure with default configuration options:\n   ```cs\n   DriverSetup.AutoSetUp(BrowserNames.Chrome);\n   ```\n1. Configure with custom configuration options:\n   ```cs\n   DriverSetup.ConfigureChrome()\n       .WithAutoVersion()\n       // Additional options can be set here.\n       .SetUp();\n   ```\n\n`DriverSetup.AutoSetUp` method also supports multiple drivers setup:\n\n```cs\nDriverSetup.AutoSetUp(BrowserNames.Chrome, BrowserNames.Edge);\n```\n\n**Note:**\nIf the version of browser cannot be detected automatically, latest driver version is used.\nVersion auto-detection is currently supported for Chrome, Firefox and Edge browsers.\n\n### Set Up Latest Version\n\n```cs\nDriverSetup.ConfigureChrome()\n    .WithLatestVersion()\n    .SetUp();\n```\n\n### Set Up Specific Version\n\n```cs\nDriverSetup.ConfigureChrome()\n    .WithVersion(\"87.0.4280.88\")\n    .SetUp();\n```\n\n**Version format:**\n- Chrome: `\"87.0.4280.88\"`\n- Firefox: `\"0.28.0\"`\n- Edge: `\"89.0.774.4\"`\n- Opera: `\"86.0.4240.80\"`\n- InternetExplorer: `\"3.141.59\"`\n\n### Set Up Version Corresponding to Specific Browser Version\n\n```cs\nDriverSetup.ConfigureChrome()\n    .ByBrowserVersion(\"87\")\n    .SetUp();\n```\n\n**Note:**\nThis feature is currently supported for Chrome, Firefox and Edge browsers.\n\n**Version format:**\n- Chrome: `\"87\"` or `\"87.0.4280\"`\n- Firefox: `\"104\"`, `\"104.0\"` or `\"104.0.1\"`\n- Edge: `\"89.0.774.4\"`\n\n## DriverSetup Members\n\n`DriverSetup` is a static class, so all its members are static too.\n\n### DriverSetup Properties\n\n- **`DriverSetupOptions GlobalOptions { get; }`**\\\n  Gets the global setup options.\n- **`DriverSetupOptionsBuilder GlobalConfiguration { get; }`**\\\n  Gets the global setup configuration builder.\n  Configures `GlobalOptions`.\n- **`List\u003cDriverSetupConfigurationBuilder\u003e PendingConfigurations { get; }`**\\\n  Gets the pending driver setup configurations,\n  the configurations that were created but were not set up.\n\n### DriverSetup Methods\n\n- **`DriverSetupConfigurationBuilder ConfigureChrome()`**\\\n  Creates the Chrome driver setup configuration builder.\n- **`DriverSetupConfigurationBuilder ConfigureFirefox()`**\\\n  Creates the Firefox/Gecko driver setup configuration builder.\n- **`DriverSetupConfigurationBuilder ConfigureEdge()`**\\\n  Creates the Edge driver setup configuration builder.\n- **`DriverSetupConfigurationBuilder ConfigureOpera()`**\\\n  Creates the Opera driver setup configuration builder.\n- **`DriverSetupConfigurationBuilder ConfigureInternetExplorer()`**\\\n  Creates the Internet Explorer driver setup configuration builder.\n- **`DriverSetupConfigurationBuilder Configure(string browserName)`**\\\n  Creates the driver setup configuration builder for the specified `browserName`.\n  Supported browser names are defined in `BrowserNames` static class.\n- **`DriverSetupConfigurationBuilder Configure(string browserName, Func\u003cIHttpRequestExecutor, IDriverSetupStrategy\u003e driverSetupStrategyFactory)`**\\\n  Creates the driver setup configuration builder using `driverSetupStrategyFactory`\n  that instantiates specific `IDriverSetupStrategy`.\n- **`DriverSetupResult AutoSetUp(string browserName)`** \u0026\\\n  **`Task\u003cDriverSetupResult\u003e AutoSetUpAsync(string browserName)`**\\\n  Sets up driver with auto version detection for the browser with the specified name.\n  Supported browser names are defined in `BrowserNames` static class.\n- **`DriverSetupResult[] AutoSetUp(params string[] browserNames)`** \u0026\\\n  **`DriverSetupResult[] AutoSetUp(IEnumerable\u003cstring\u003e browserNames)`** \u0026\\\n  **`Task\u003cDriverSetupResult[]\u003e AutoSetUpAsync(params string[] browserNames)`** \u0026\\\n  **`Task\u003cDriverSetupResult[]\u003e AutoSetUpAsync(IEnumerable\u003cstring\u003e browserNames)`**\\\n  Sets up drivers with auto version detection for the browsers with the specified names.\n  Supported browser names are defined in `BrowserNames` static class.\n- **`DriverSetupResult[] AutoSetUpSafely(IEnumerable\u003cstring\u003e browserNames)`** \u0026\\\n  **`Task\u003cDriverSetupResult[]\u003e AutoSetUpSafelyAsync(IEnumerable\u003cstring\u003e browserNames)`**\\\n  Sets up drivers with auto version detection for the browsers with the specified names.\n  Supported browser names are defined in `BrowserNames` static class.\n  Skips invalid/unsupported browser names.\n- **`DriverSetupOptionsBuilder GetDefaultConfiguration(string browserName)`**\\\n  Gets the default driver setup configuration builder.\n- **`DriverSetupResult[] SetUpPendingConfigurations()`** \u0026\\\n  **`Task\u003cDriverSetupResult[]\u003e SetUpPendingConfigurationsAsync()`**\\\n  Sets up pending configurations that are stored in `PendingConfigurations` property.\n- **`void RegisterStrategyFactory(string browserName, Func\u003cIHttpRequestExecutor, IDriverSetupStrategy\u003e driverSetupStrategyFactory)`**\\\n  Registers the driver setup strategy factory.\n\n## Configuration\n\nIt's possible to set configuration options globally and separately for a specific driver.\n\n### Global Configuration\n\n#### Using Fluent Builder\n\n```cs\nDriverSetup.GlobalConfiguration\n    .WithStorageDirectoryPath(\"...\")\n    .WithVersionCache(false);\n```\n\n#### Using Options Properties\n\n```cs\nDriverSetup.GlobalOptions.StorageDirectoryPath = \"...\";\nDriverSetup.GlobalOptions.UseVersionCache = false;\n```\n\n### Default Driver Configuration\n\n```cs\nDriverSetup.GetDefaultConfiguration(BrowserNames.InternetExplorer)\n    .WithX32Architecture();\n```\n\n### Driver-Specific Configuration\n\n```cs\nDriverSetup.ConfigureChrome()\n    .WithStorageDirectoryPath(\"...\")\n    .WithVersionCache(false)\n    .SetUp();\n```\n\n*Don't forget to call `SetUp()` or `SetUpAsync()` at the end.*\n\n### Configuration Methods\n\n#### Driver-Specific Configuration Methods\n\n- **`WithAutoVersion()`**\\\n  Sets the automatic driver version detection by installed browser version.\n  If the version cannot be detected automatically, latest driver version should be used.\n- **`WithLatestVersion()`**\\\n  Sets the latest version of driver.\n- **`ByBrowserVersion(string version)`**\\\n  Sets the browser version.\n  It will find driver version corresponding to the browser version.\n- **`WithVersion(string version)`**\\\n  Sets the version of driver to use.\n- **`WithEnvironmentVariableName(string variableName)`**\\\n  Sets the name of the environment variable\n  that will be set with a value equal to the driver directory path.\n  The default value is specific to the driver being configured.\n  It has `\"{BrowserName}Driver\"` format.\n  For example: `\"ChromeDriver\"` or `\"InternetExplorerDriver\"`.\n  The `null` value means that none variable should be set.\n\n#### Common Configuration Methods\n\n- **`WithStorageDirectoryPath(string path)`**\\\n  Sets the storage directory path.\n  The default value is `\"{basedir}/drivers\")`.\n- **`WithX32Architecture()`**\\\n  Sets the x32 (x86) architecture.\n- **`WithX64Architecture()`**\\\n  Sets the x64 architecture.\n- **`WithArm64Architecture()`**\\\n  Sets the ARM64 architecture.\n- **`WithArchitecture(Architecture architecture)`**\\\n  Sets the architecture.\n  The default value is `Architecture.Auto`.\n- **`WithProxy(IWebProxy proxy)`**\\\n  Sets the web proxy.\n- **`WithCheckCertificateRevocationList(bool checkCertificateRevocationList)`**\\\n  Sets a value indicating whether the certificate is automatically picked\n  from the certificate store or if the caller is allowed to pass in a specific\n  client certificate.\n  The default value is `true`.\n- **`WithHttpClientHandlerConfiguration(Action\u003cHttpClientHandler\u003e httpClientHandlerConfigurationAction)`**\\\n  Sets the configuration action of `HttpClientHandler`.\n  The `HttpClientHandler` instance is used to get a driver version information\n  and to download a driver archive.\n- **`WithMutex(bool isEnabled)`**\\\n  Sets a value indicating whether to use mutex to sync driver setup across machine..\n  The default value is `true`.\n- **`WithVersionCache(bool isEnabled)`**\\\n  Sets a value indicating whether to use version cache.\n  The default value is `true`.\n- **`WithLatestVersionCheckInterval(TimeSpan interval)`**\\\n  Sets the latest version check interval.\n  The default values is `2` hours.\n- **`WithSpecificVersionCheckInterval(TimeSpan interval)`**\\\n  Sets the specific version check interval.\n  The default values is `2` hours.\n- **`WithHttpRequestTryCount(int count)`**\\\n  Sets the HTTP request try count.\n  The default values is `3`.\n- **`WithHttpRequestRetryInterval(TimeSpan interval)`**\\\n  Sets the HTTP request retry interval.\n  The default values is `3` seconds.\n- **`WithEnabledState(bool isEnabled)`**\\\n  Sets a value indicating whether the configuration is enabled.\n  The default values is `true`.\n- **`WithAddToEnvironmentPathVariable(bool isEnabled)`**\\\n  Sets a value indicating whether to add the driver directory path\n  to environment \"Path\" variable.\n  The default value is `true`.\n\n### Handle HTTPS Certificate Errors\n\nRarely you can get HTTP certificate errors during driver setup.\nIn order to handle such errors you can try one or both of the configuration settings below.\n\n```cs\nDriverSetup.GlobalConfiguration\n    .WithCheckCertificateRevocationList(false)\n    .WithHttpClientHandlerConfiguration(x =\u003e x.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator);\n```\n\n## BrowserDetector\n\n`BrowserDetector` - provides a set of static methods for a detection of browser installations.\nBrowser detection is supported for Chrome, Firefox and Edge,\nso as a browser name the following constants can be used:\n\n- `BrowserNames.Chrome`\n- `BrowserNames.Firefox`\n- `BrowserNames.Edge`\n\n### BrowserDetector Methods\n\n- **`string GetInstalledBrowserVersion(string browserName)`**\\\n  Gets the installed browser version by the browser name.\n- **`bool IsBrowserInstalled(string browserName)`**\\\n  Determines whether the browser with the specified name is installed.\n- **`string GetFirstInstalledBrowserName(params string[] browserNames)`**\\\n Gets the name of the first installed browser among the `browserNames`.\n- **`string GetFirstInstalledBrowserName(IEnumerable\u003cstring\u003e browserNames)`**\\\n Gets the name of the first installed browser among the `browserNames`.\n\n### BrowserDetector Usage\n\n#### Get First Installed Browser Name\n\n```cs\nstring browserName = BrowserDetector.GetFirstInstalledBrowserName(\n    BrowserNames.Chrome,\n    BrowserNames.Firefox,\n    BrowserNames.Edge);\n```\n\n#### Is Browser Installed\n\n```cs\nbool isChromeInstalled = BrowserDetector.IsBrowserInstalled(BrowserNames.Chrome);\n```\n\n#### Get Installed Browser Version\n\n```cs\nstring chromeVersion = BrowserDetector.GetInstalledBrowserVersion(BrowserNames.Chrome);\n```\n\n## Feedback\n\nAny feedback, issues and feature requests are welcome.\n\nIf you faced an issue please report it to [Atata.WebDriverSetup Issues](https://github.com/atata-framework/atata-webdriversetup/issues),\n[ask a question on Stack Overflow](https://stackoverflow.com/questions/ask?tags=atata+csharp) using [atata](https://stackoverflow.com/questions/tagged/atata) tag\nor use another [Atata Contact](https://atata.io/contact/) way.\n\n## SemVer\n\nAtata Framework follows [Semantic Versioning 2.0](https://semver.org/).\nThus backward compatibility is followed and updates within the same major version\n(e.g. from 1.3 to 1.4) should not require code changes.\n\n## License\n\nAtata is an open source software, licensed under the Apache License 2.0.\nSee [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatata-framework%2Fatata-webdriversetup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatata-framework%2Fatata-webdriversetup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatata-framework%2Fatata-webdriversetup/lists"}