Defines a WebDriver client for Microsoft's Edge web browser. Edge (Chromium) is supported and support for Edge Legacy (EdgeHTML) as part of https://github.com/SeleniumHQ/selenium/issues/9166. Before using this module, you must download and install the correct WebDriver server.
Ensure that the msedgedriver (Chromium) is on your PATH.
You may use Options to specify whether Edge Chromium options should be used: const edge = require('selenium-webdriver/edge'); const options = new edge.Options(); There are three primary classes exported by this module:
ServiceBuilder: configures the remote.DriverService that manages the [WebDriver] child process.
Options: defines configuration options for each new WebDriver session, such as which proxy to use when starting the browser.
Driver: the WebDriver client; each new instance will control a unique browser session.
Customizing the WebDriver Server
By default, every MicrosoftEdge session will use a single driver service, which is started the first time a Driver instance is created and terminated when this process exits. The default service will inherit its environment from the current process. You may obtain a handle to this default service using getDefaultService() and change its configuration with setDefaultService().
You may also create a Driver with its own driver service. This is useful if you need to capture the server's log output for a specific session:
const edge = require('selenium-webdriver/edge');
const service = new edge.ServiceBuilder()
.setPort(55555)
.build();
let options = new edge.Options();
// configure browser options ...
let driver = edge.Driver.createSession(options, service);
Users should only instantiate the Driver class directly when they need a custom driver service configuration (as shown above). For normal operation, users should start msedgedriver using the selenium-webdriver.Builder.