Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:SeleniumHQ Selenium EdgeDriverService

From Leeroopedia
Knowledge Sources
Domains WebDriver, Edge_Browser
Last Updated 2026-02-12 00:00 GMT

Overview

EdgeDriverService manages the lifecycle of the MSEdgeDriver process, extending DriverService to provide Edge-specific configuration for logging, IP allowlisting, build version checks, and WebView2 support.

Description

EdgeDriverService is the service class responsible for starting, configuring, and stopping the MSEdgeDriver executable that acts as a bridge between Selenium WebDriver commands and the Microsoft Edge browser. It extends DriverService and provides:

  • System property constants for configuring the driver executable path, log file location, log level, verbosity, silent mode, IP allowlisting, readable timestamps, and build check behavior.
  • A nested Builder class (registered via @AutoService) that uses a fluent API to configure service options and create instances.
  • Support for WebView2 browser automation alongside standard Edge browser sessions.
  • Integration with system properties and environment variables for zero-code configuration.

The Builder.score() method is used by the service provider mechanism to determine the best matching service for given capabilities, scoring positively for Edge browser capabilities, WebView2 browser name, and Edge-specific options.

Usage

Use EdgeDriverService when you need fine-grained control over the MSEdgeDriver process, such as specifying log output, controlling verbosity, restricting allowed IP addresses, or disabling build version checks. For most cases, createDefaultService() or letting EdgeDriver manage the service automatically is sufficient.

Code Reference

Source Location

Signature

public class EdgeDriverService extends DriverService {

  public static final String EDGE_DRIVER_NAME = "msedgedriver";
  public static final String EDGE_DRIVER_EXE_PROPERTY = "webdriver.edge.driver";
  public static final String EDGE_DRIVER_EXE_ENVIRONMENT_VARIABLE = "SE_EDGEDRIVER";
  public static final String EDGE_DRIVER_READABLE_TIMESTAMP = "webdriver.edge.readableTimestamp";
  public static final String EDGE_DRIVER_LOG_PROPERTY = "webdriver.edge.logfile";
  public static final String EDGE_DRIVER_LOG_LEVEL_PROPERTY = "webdriver.edge.loglevel";
  public static final String EDGE_DRIVER_APPEND_LOG_PROPERTY = "webdriver.edge.appendLog";
  public static final String EDGE_DRIVER_VERBOSE_LOG_PROPERTY = "webdriver.edge.verboseLogging";
  public static final String EDGE_DRIVER_SILENT_OUTPUT_PROPERTY = "webdriver.edge.silentOutput";
  public static final String EDGE_DRIVER_ALLOWED_IPS_PROPERTY = "webdriver.edge.withAllowedIps";
  public static final String EDGE_DRIVER_DISABLE_BUILD_CHECK = "webdriver.edge.disableBuildCheck";

  public EdgeDriverService(File executable, int port, Duration timeout,
                           List<String> args, Map<String, String> environment) throws IOException

  public static EdgeDriverService createDefaultService()

  public static class Builder extends DriverService.Builder<EdgeDriverService, Builder> {
    public Builder withAppendLog(boolean appendLog)
    public Builder withBuildCheckDisabled(boolean noBuildCheck)
    public Builder withLoglevel(ChromiumDriverLogLevel logLevel)
    public Builder withSilent(boolean silent)
    public Builder withVerbose(boolean verbose)
    public Builder withAllowedListIps(String allowedListIps)
    public Builder withReadableTimestamp(Boolean readableTimestamp)
  }
}

Import

import org.openqa.selenium.edge.EdgeDriverService;

I/O Contract

Constructor Parameters

Parameter Type Required Description
executable File Yes Path to the MSEdgeDriver executable
port int Yes Port number for the driver server
timeout Duration Yes Timeout waiting for the driver server to start
args List<String> Yes Command-line arguments for the driver server
environment Map<String, String> Yes Environment variables for the driver server process

System Properties

Property Type Description
webdriver.edge.driver String Path to the MSEdgeDriver executable
webdriver.edge.logfile String Path to the log output file
webdriver.edge.loglevel String Log level (maps to ChromiumDriverLogLevel)
webdriver.edge.readableTimestamp boolean Enable human-readable log timestamps
webdriver.edge.appendLog boolean Append to log file instead of overwriting
webdriver.edge.verboseLogging boolean Enable verbose logging (sets level to ALL)
webdriver.edge.silentOutput boolean Suppress all output (sets level to OFF)
webdriver.edge.withAllowedIps String Comma-separated list of allowed remote IPv4 addresses
webdriver.edge.disableBuildCheck boolean Disable browser/driver version compatibility check

Builder Methods

Method Parameter Type Description
withAppendLog(boolean) boolean Append to log file rather than overwriting
withBuildCheckDisabled(boolean) boolean Disable version compatibility check
withLoglevel(ChromiumDriverLogLevel) ChromiumDriverLogLevel Set the driver log level; resets silent and verbose
withSilent(boolean) boolean Enable silent mode (log level OFF)
withVerbose(boolean) boolean Enable verbose mode (log level ALL)
withAllowedListIps(String) String Comma-separated IPv4 addresses allowed to connect
withReadableTimestamp(Boolean) Boolean Enable readable timestamp formatting in logs

Usage Examples

// Using the default service (most common)
EdgeDriverService service = EdgeDriverService.createDefaultService();
EdgeDriver driver = new EdgeDriver(service, new EdgeOptions());

// Using the Builder for custom configuration
EdgeDriverService service = new EdgeDriverService.Builder()
    .withLoglevel(ChromiumDriverLogLevel.INFO)
    .withAppendLog(true)
    .withReadableTimestamp(true)
    .withAllowedListIps("127.0.0.1,192.168.1.100")
    .withBuildCheckDisabled(true)
    .build();

EdgeDriver driver = new EdgeDriver(service, new EdgeOptions());

// Configure via system properties (no code changes needed)
System.setProperty("webdriver.edge.logfile", "/tmp/edge-driver.log");
System.setProperty("webdriver.edge.loglevel", "INFO");
System.setProperty("webdriver.edge.readableTimestamp", "true");
EdgeDriver driver = new EdgeDriver();

// Using verbose logging for debugging
EdgeDriverService service = new EdgeDriverService.Builder()
    .withVerbose(true)
    .build();

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment