What is webdriver-manager?
The webdriver-manager npm package is a tool for managing WebDriver binaries. It is commonly used to download, update, and start WebDriver binaries for Selenium WebDriver, making it easier to set up and manage the necessary components for running automated browser tests.
What are webdriver-manager's main functionalities?
Download WebDriver binaries
This feature allows you to download the necessary WebDriver binaries for your browser. The `update` method fetches the latest versions of the binaries and stores them locally.
const webdriverManager = require('webdriver-manager');
webdriverManager.update();
Start WebDriver server
This feature starts the WebDriver server, which is necessary for running Selenium WebDriver tests. The `start` method launches the server and makes it ready to accept WebDriver commands.
const webdriverManager = require('webdriver-manager');
webdriverManager.start();
Stop WebDriver server
This feature stops the WebDriver server. The `shutdown` method gracefully stops the server, ensuring that all resources are properly released.
const webdriverManager = require('webdriver-manager');
webdriverManager.shutdown();
Other packages similar to webdriver-manager
selenium-standalone
The selenium-standalone package is similar to webdriver-manager in that it helps manage Selenium WebDriver binaries. It provides commands to install, start, and stop the Selenium server. Compared to webdriver-manager, selenium-standalone offers more flexibility in configuring the Selenium server and supports a wider range of browsers and versions.
chromedriver
The chromedriver package is specifically designed to manage the ChromeDriver binary. It allows you to download, update, and start the ChromeDriver server. While it is more limited in scope compared to webdriver-manager, it is a good choice if you only need to work with Chrome.
geckodriver
The geckodriver package is similar to chromedriver but is focused on managing the GeckoDriver binary for Firefox. It provides functionality to download, update, and start the GeckoDriver server. Like chromedriver, it is more specialized and limited in scope compared to webdriver-manager.
Webdriver Manager
A selenium server and browser driver manager for your end to end tests. This is the same tool as webdriver-manager
from the Protractor repository.
Note: Version 9 and lower please reference pose/webdriver-manager. If there are features that existed in version 9 and lower, please open up an issue with the missing feature or a create a pull request.
Getting Started
npm install -g webdriver-manager
Setting up a Selenium Server
Prior to starting the selenium server, download the selenium server jar and driver binaries. By default it will download the selenium server jar and chromedriver binary.
webdriver-manager update
Starting the Selenium Server
By default, the selenium server will run on http://localhost:4444/wd/hub
.
webdriver-manager start
Other useful commands
View different versions of server and driver files:
webdriver-manager status
Clear out the server and driver files. If webdriver-manager start
does not work, try to clear out the saved files.
webdriver-manager clean
Running / stopping server in background process (stopping is not yet supported on standalone server 3.x.x):
webdriver-manager start --detach
webdriver-manager shutdown
Other topics: