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
Other topics:
12.0.0
Changes to update
This release gets the latest release for selenium standalone, chromedriver,
iedriver, and gecko driver by downloading and parsing either a json or xml file.
These json or xml files are cached in the selenium directory. This means for
users that provide an alternative cdn will also be required to provide the proper
xml or json server response to find these binaries.
Since we are always downloading the latest, the config.json
versions will no
longer be a place to override these.
Changes to start
If a new release is out and you have old binaries, running webdriver-manager start
without specifying any versions should throw an error. The error will
tell the user that the binary is not present.
Changes to status
Since we are downloading the latest and not maintaining a default version in
config.json
, we are dropping the default tag.
Features
-
(fe309ef)
feat(latest): get the latest version from the cdn (#198)
This reads the xml from the CDN to get the latest chromedriver, iedriver,
or standalone version if the version is 'latest'. If the release is from
Github, use the Github API to get the releases. Also store the downloaded
information to a cache in the output directory (default: selenium/). If
the file is older than one hour it will be rewritten.
When getting the status, we are no longer showing the default version.
Default versions will be deprecated and will be removed from the config.json
file.
When starting the standalone server, use the 'latest' version by default
unless specified by --versions.{binary} flag.
Change the gulp update task to use 3.0.0-beta4 so Firefox tests will pass.