Microsoft Edge WebDriver implementation for Selenium WebDriver browser automation with EdgeOptions configuration and EdgeDriverService management.
npx @tessl/cli install tessl/maven-org-seleniumhq-selenium--selenium-edge-driver@4.33.00
# Selenium Edge Driver
1
2
Selenium Edge Driver is a Microsoft Edge WebDriver implementation for Selenium WebDriver browser automation. It extends the ChromiumDriver base class and provides Edge-specific functionality including EdgeOptions for browser configuration, EdgeDriverService for managing the EdgeDriver executable, and full WebDriver API compatibility.
3
4
## Package Information
5
6
- **Package Name**: selenium-edge-driver
7
- **Package Type**: maven
8
- **Language**: Java
9
- **Installation**:
10
```xml
11
<dependency>
12
<groupId>org.seleniumhq.selenium</groupId>
13
<artifactId>selenium-edge-driver</artifactId>
14
<version>4.33.0</version>
15
</dependency>
16
```
17
18
## Core Imports
19
20
```java
21
import org.openqa.selenium.edge.EdgeDriver;
22
import org.openqa.selenium.edge.EdgeOptions;
23
import org.openqa.selenium.edge.EdgeDriverService;
24
```
25
26
## Basic Usage
27
28
```java
29
import org.openqa.selenium.edge.EdgeDriver;
30
import org.openqa.selenium.edge.EdgeOptions;
31
32
// Basic usage with default options
33
EdgeDriver driver = new EdgeDriver();
34
35
// With custom options
36
EdgeOptions options = new EdgeOptions();
37
options.addArguments("--headless");
38
options.addArguments("--disable-gpu");
39
EdgeDriver driver = new EdgeDriver(options);
40
41
// Navigate and interact
42
driver.get("https://example.com");
43
String title = driver.getTitle();
44
driver.quit();
45
```
46
47
## Architecture
48
49
Selenium Edge Driver is built around several key components:
50
51
- **EdgeDriver**: Main WebDriver implementation extending ChromiumDriver for Edge browser control
52
- **EdgeOptions**: Configuration class extending ChromiumOptions for Edge-specific browser options and capabilities
53
- **EdgeDriverService**: Service management class for EdgeDriver executable lifecycle and configuration
54
- **EdgeDriverInfo**: Metadata provider and factory for EdgeDriver instances with capability matching
55
- **Chrome DevTools Protocol (CDP)**: Advanced browser control via AddHasCdp for debugging and performance monitoring
56
- **Casting Support**: Media streaming capabilities via AddHasCasting for Chromecast functionality
57
58
## Capabilities
59
60
### Edge Driver
61
62
Core WebDriver implementation providing full browser automation capabilities for Microsoft Edge. Supports both regular Edge browser and WebView2 applications.
63
64
```java { .api }
65
public class EdgeDriver extends ChromiumDriver {
66
public EdgeDriver();
67
public EdgeDriver(EdgeOptions options);
68
public EdgeDriver(EdgeDriverService service);
69
public EdgeDriver(EdgeDriverService service, EdgeOptions options);
70
public EdgeDriver(EdgeDriverService service, EdgeOptions options, ClientConfig clientConfig);
71
72
@Beta
73
public static RemoteWebDriverBuilder builder();
74
}
75
```
76
77
[Edge Driver](./edge-driver.md)
78
79
### Edge Options
80
81
Configuration and capability management for EdgeDriver with Edge-specific options and WebView2 support.
82
83
```java { .api }
84
public class EdgeOptions extends ChromiumOptions<EdgeOptions> {
85
public static final String CAPABILITY = "ms:edgeOptions";
86
public static final String LOGGING_PREFS = "ms:loggingPrefs";
87
public static final String WEBVIEW2_BROWSER_NAME = "webview2";
88
89
public EdgeOptions();
90
public EdgeOptions useWebView(boolean enable);
91
public EdgeOptions merge(Capabilities extraCapabilities);
92
}
93
```
94
95
[Edge Options](./edge-options.md)
96
97
### Edge Driver Service
98
99
Lifecycle management for the EdgeDriver executable with extensive configuration options for logging, networking, and operational behavior.
100
101
```java { .api }
102
public class EdgeDriverService extends DriverService {
103
public static final String EDGE_DRIVER_NAME = "msedgedriver";
104
public static final String EDGE_DRIVER_EXE_PROPERTY = "webdriver.edge.driver";
105
106
public EdgeDriverService(File executable, int port, Duration timeout, List<String> args, Map<String, String> environment);
107
public String getDriverName();
108
public String getDriverProperty();
109
public Capabilities getDefaultDriverOptions();
110
111
public static EdgeDriverService createDefaultService();
112
113
public static class Builder extends DriverService.Builder<EdgeDriverService, Builder> {
114
public Builder withAppendLog(boolean appendLog);
115
public Builder withBuildCheckDisabled(boolean noBuildCheck);
116
public Builder withLoglevel(ChromiumDriverLogLevel logLevel);
117
public Builder withSilent(boolean silent);
118
public Builder withVerbose(boolean verbose);
119
public Builder withAllowedListIps(String allowedListIps);
120
public Builder withReadableTimestamp(Boolean readableTimestamp);
121
}
122
}
123
```
124
125
[Edge Driver Service](./edge-driver-service.md)
126
127
### Edge Driver Info
128
129
Metadata provider and factory for EdgeDriver instances with capability matching and WebDriver integration.
130
131
```java { .api }
132
public class EdgeDriverInfo extends ChromiumDriverInfo {
133
public String getDisplayName();
134
public Capabilities getCanonicalCapabilities();
135
public boolean isSupporting(Capabilities capabilities);
136
public boolean isSupportingCdp();
137
public boolean isSupportingBiDi();
138
public boolean isAvailable();
139
public boolean isPresent();
140
public Optional<WebDriver> createDriver(Capabilities capabilities);
141
}
142
```
143
144
[Edge Driver Info](./edge-driver-info.md)
145
146
## Common Usage Patterns
147
148
### WebView2 Automation
149
```java
150
EdgeOptions options = new EdgeOptions();
151
options.useWebView(true);
152
EdgeDriver driver = new EdgeDriver(options);
153
```
154
155
### Custom Service Configuration
156
```java
157
EdgeDriverService service = new EdgeDriverService.Builder()
158
.withVerbose(true)
159
.withLogFile(new File("edge-driver.log"))
160
.withAllowedListIps("127.0.0.1")
161
.build();
162
EdgeDriver driver = new EdgeDriver(service);
163
```
164
165
### Remote WebDriver Builder
166
```java
167
EdgeOptions options = new EdgeOptions();
168
RemoteWebDriver driver = EdgeDriver.builder()
169
.oneOf(options)
170
.address("http://localhost:4444")
171
.build();
172
```