Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,10 @@ npx geckodriver --port=4444
# Start Edgedriver
npx edgedriver --port=4444

# Start Safaridriver (macOS)
npx safaridriver --port=4444

```

The `safaridriver` package has no CLI: Safaridriver is part of macOS, so run `/usr/bin/safaridriver --port=4444` directly (once, run `safaridriver --enable` to allow remote automation).

### Environment Variables & Global Installation Setup

#### Auto-Installation Flags
Expand Down Expand Up @@ -103,13 +102,19 @@ By default, binaries download when initialized via CLI or API. To download them

#### Windows Setup (`selenium-webdriver` note)

When installing `geckodriver` or `edgedriver` globally on Windows, `selenium-webdriver` expects the `.exe` extension in PATH. You can create a symlink in your global npm binary directory:
A global install on Windows adds `geckodriver.cmd` and `edgedriver.cmd` to your `PATH`, but `selenium-webdriver` looks for `geckodriver.exe` and `msedgedriver.exe`. The packages download the binary into their cache folder, not into the package folder: `geckodriver-<version>.exe` in `GECKODRIVER_CACHE_DIR`, `msedgedriver.exe` in `EDGEDRIVER_CACHE_DIR` (both default to the system temporary folder). Set the cache folder and the version, run the driver once, then copy the binary to a folder on your `PATH`:

```cmd
mklink %USERPROFILE%\AppData\Roaming\npm\geckodriver.exe %USERPROFILE%\AppData\Roaming\npm\node_modules\geckodriver\geckodriver.exe

set GECKODRIVER_CACHE_DIR=%USERPROFILE%\geckodriver
set GECKODRIVER_VERSION=0.37.1
geckodriver --version
copy /Y %GECKODRIVER_CACHE_DIR%\geckodriver-%GECKODRIVER_VERSION%.exe %APPDATA%\npm\geckodriver.exe
```

Name the exact version: with a wildcard, `copy` joins all cached versions into one broken file.

Recent `selenium-webdriver` versions can also download the drivers themselves with Selenium Manager.

---

## Programmatic Usage
Expand Down
11 changes: 8 additions & 3 deletions packages/node-geckodriver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ Or install it globally:
npm install -g geckodriver
```

__Note:__ This installs a `geckodriver` shell script that runs the executable, but on Windows, [`selenium-webdriver`](https://www.npmjs.com/package/selenium-webdriver) looks for `geckodriver.exe`. To use a global installation of this package with [`selenium-webdriver`](https://www.npmjs.com/package/selenium-webdriver) on Windows, copy or link `geckodriver.exe` to a location on your `PATH` (such as the npm bin directory) after installing this package:
__Note:__ This installs a `geckodriver` shell script that runs the executable, but on Windows, [`selenium-webdriver`](https://www.npmjs.com/package/selenium-webdriver) looks for `geckodriver.exe`. The package downloads the binary into its cache folder (`GECKODRIVER_CACHE_DIR`, by default the system temporary folder) as `geckodriver-<version>.exe`, not into the package folder. Set the cache folder and the version, run the driver once, then copy the binary to a folder on your `PATH` (such as the npm bin directory):

```sh
mklink %USERPROFILE%\AppData\Roaming\npm\geckodriver.exe %USERPROFILE%\AppData\Roaming\npm\node_modules\geckodriver\geckodriver.exe
```cmd
set GECKODRIVER_CACHE_DIR=%USERPROFILE%\geckodriver
set GECKODRIVER_VERSION=0.37.1
geckodriver --version
copy /Y %GECKODRIVER_CACHE_DIR%\geckodriver-%GECKODRIVER_VERSION%.exe %APPDATA%\npm\geckodriver.exe
```

Name the exact version: with a wildcard, `copy` joins all cached versions into one broken file.

Once installed you can start Geckodriver via:

```sh
Expand Down
Loading