# Selenium browsers and drivers

Avrea caches the browser and driver downloads made by Selenium Manager for
Chrome, Firefox, and Edge. Repeated downloads reuse the packages cache, even
when each job starts with an empty Selenium cache directory.

## On Avrea runners

When **Package Manager Cache** and **Selenium Browser & Driver Cache** are
enabled, Avrea sets these mirrors on Linux, macOS, and Windows:

```bash
SE_CHROME_MIRROR_URL="https://cache.avrea.com:8443/selenium/chrome/"
SE_CHROMEDRIVER_MIRROR_URL="https://cache.avrea.com:8443/selenium/chromedriver/"
SE_FIREFOX_MIRROR_URL="https://cache.avrea.com:8443/selenium/firefox/"
SE_GECKODRIVER_MIRROR_URL="https://cache.avrea.com:8443/selenium/geckodriver/"
SE_EDGE_MIRROR_URL="https://cache.avrea.com:8443/selenium/edge/"
SE_MICROSOFTEDGE_MIRROR_URL="https://cache.avrea.com:8443/selenium/edge/"
SE_MSEDGE_MIRROR_URL="https://cache.avrea.com:8443/selenium/edge/"
SE_MSEDGEDRIVER_MIRROR_URL="https://cache.avrea.com:8443/selenium/msedgedriver/"
```

Use Selenium normally. Selenium Manager selects and downloads browsers and
drivers as usual, and Avrea reuses cached downloads across jobs.

## What is cached

| Family | Downloads |
| --- | --- |
| Chrome | Chrome for Testing and ChromeDriver |
| Firefox | Release browser installers and GeckoDriver |
| Edge | Browser installers and EdgeDriver |

View cache activity under **Selenium · Browsers & drivers** in the console.

## Enable or disable

**Selenium Browser & Driver Cache** (`cache.selenium-browsers.enabled`) is enabled by
default. Change it at organization or repository level under **Settings** in
the [Avrea console](https://console.avrea.com). **Package Manager Cache**
(`cache.packages.enabled`) must also be enabled.

Disable it for a repository:

```bash
avr settings set cache.selenium-browsers.enabled false
```

Re-enable it:

```bash
avr settings set cache.selenium-browsers.enabled true
```

Reset to the inherited default:

```bash
avr settings reset cache.selenium-browsers.enabled
```

Repository overrides take precedence over organization settings. Changes apply
to new jobs. See [Managing caches](/cache/managing/#cache-settings).

## Overrides

Workflow or step environment variables can replace the corresponding mirror.
To use Selenium Manager's default Chrome endpoints for a step, clear both Chrome
mirrors:

```yaml
- run: python browser_test.py
  env:
    SE_CHROME_MIRROR_URL: ""
    SE_CHROMEDRIVER_MIRROR_URL: ""
```

Clear the Firefox pair in the same way. For Edge, clear all three browser aliases
and `SE_MSEDGEDRIVER_MIRROR_URL`, or disable the Selenium
cache setting for the repository.

Custom generic mirrors (`SE_BROWSER_MIRROR_URL` and `SE_DRIVER_MIRROR_URL`)
take precedence over Avrea's mirrors. Leave them unset or empty to use Avrea's
cache.

Selenium Manager CLI mirror options take precedence over this configuration.
For each configuration key, a value in `se-config.toml` takes precedence over
its environment variable. Generic mirror keys are checked before specific keys.

See [Selenium Manager configuration](https://www.selenium.dev/documentation/selenium_manager/#configuration).