0
# Selenium Internet Explorer Driver
1
2
The Selenium Internet Explorer Driver provides automated browser control capabilities specifically for Internet Explorer browsers through the Selenium WebDriver API. It implements the W3C WebDriver specification and offers a comprehensive Java API for controlling IE browser instances, including capabilities for navigation, element interaction, window management, and browser-specific configuration options.
3
4
## Package Information
5
6
- **Package Name**: selenium-ie-driver
7
- **Package Type**: maven
8
- **Language**: Java
9
- **Maven Coordinates**: `org.seleniumhq.selenium:selenium-ie-driver:4.33.0`
10
- **Installation**: Add to `pom.xml`:
11
12
```xml
13
<dependency>
14
<groupId>org.seleniumhq.selenium</groupId>
15
<artifactId>selenium-ie-driver</artifactId>
16
<version>4.33.0</version>
17
</dependency>
18
```
19
20
## Core Imports
21
22
```java
23
import org.openqa.selenium.ie.InternetExplorerDriver;
24
import org.openqa.selenium.ie.InternetExplorerOptions;
25
import org.openqa.selenium.ie.InternetExplorerDriverService;
26
```
27
28
## Basic Usage
29
30
```java
31
import org.openqa.selenium.ie.InternetExplorerDriver;
32
import org.openqa.selenium.ie.InternetExplorerOptions;
33
import org.openqa.selenium.ie.InternetExplorerDriverService;
34
import org.openqa.selenium.WebDriver;
35
import org.openqa.selenium.By;
36
import org.openqa.selenium.WebElement;
37
38
// Basic IE driver with default settings
39
WebDriver driver = new InternetExplorerDriver();
40
41
// IE driver with custom options for better reliability
42
InternetExplorerOptions options = new InternetExplorerOptions()
43
.ignoreZoomSettings() // Ignore zoom level for consistent element location
44
.requireWindowFocus() // Ensure window has focus for interaction
45
.enablePersistentHovering() // Improve hover behavior
46
.withInitialBrowserUrl("about:blank"); // Set initial URL
47
48
WebDriver driver = new InternetExplorerDriver(options);
49
50
try {
51
// Navigate to a website
52
driver.get("https://example.com");
53
54
// Find and interact with elements
55
WebElement searchBox = driver.findElement(By.name("q"));
56
searchBox.sendKeys("Selenium WebDriver");
57
58
WebElement submitButton = driver.findElement(By.xpath("//input[@type='submit']"));
59
submitButton.click();
60
61
// Wait and verify results
62
Thread.sleep(2000);
63
System.out.println("Page title: " + driver.getTitle());
64
65
} finally {
66
// Always clean up resources
67
driver.quit();
68
}
69
```
70
71
## Architecture
72
73
The Selenium IE Driver is built around several key components:
74
75
- **InternetExplorerDriver**: Main WebDriver implementation extending RemoteWebDriver
76
- **InternetExplorerOptions**: Fluent configuration API for IE-specific capabilities
77
- **InternetExplorerDriverService**: Service management for IEDriverServer executable lifecycle
78
- **Capability System**: String constants for all IE-specific browser capabilities
79
- **Service Builder Pattern**: Configurable service creation with logging, host binding, and path options
80
81
## Platform Requirements
82
83
- **Operating System**: Windows only (throws WebDriverException on other platforms)
84
- **Browser**: Internet Explorer installed on the system
85
- **Driver Executable**: IEDriverServer.exe (automatically managed by Selenium Manager)
86
- **Permissions**: May require administrator privileges for certain security settings
87
88
## Capabilities
89
90
### WebDriver Implementation
91
92
Core WebDriver functionality for creating and managing Internet Explorer browser instances. Provides the main entry point for IE automation.
93
94
```java { .api }
95
public class InternetExplorerDriver extends RemoteWebDriver {
96
public InternetExplorerDriver();
97
public InternetExplorerDriver(InternetExplorerOptions options);
98
public InternetExplorerDriver(InternetExplorerDriverService service);
99
public InternetExplorerDriver(
100
InternetExplorerDriverService service,
101
InternetExplorerOptions options
102
);
103
public InternetExplorerDriver(
104
InternetExplorerDriverService service,
105
InternetExplorerOptions options,
106
ClientConfig clientConfig
107
);
108
109
public static RemoteWebDriverBuilder builder(); // @Beta
110
}
111
```
112
113
[WebDriver Implementation](./webdriver.md)
114
115
### Configuration Options
116
117
Comprehensive configuration system for IE-specific browser settings and behaviors. Supports fluent API pattern for easy configuration chaining.
118
119
```java { .api }
120
public class InternetExplorerOptions extends AbstractDriverOptions<InternetExplorerOptions> {
121
public InternetExplorerOptions();
122
public InternetExplorerOptions(Capabilities source);
123
124
public InternetExplorerOptions merge(Capabilities extraCapabilities);
125
public InternetExplorerOptions ignoreZoomSettings();
126
public InternetExplorerOptions requireWindowFocus();
127
public InternetExplorerOptions enablePersistentHovering();
128
public InternetExplorerOptions withInitialBrowserUrl(String url);
129
public InternetExplorerOptions elementScrollTo(ElementScrollBehavior behavior);
130
}
131
```
132
133
[Configuration Options](./options.md)
134
135
### Service Management
136
137
Service lifecycle management for the IEDriverServer executable, including process creation, configuration, and cleanup.
138
139
```java { .api }
140
public class InternetExplorerDriverService extends DriverService {
141
public static InternetExplorerDriverService createDefaultService();
142
143
public static class Builder extends DriverService.Builder<
144
InternetExplorerDriverService,
145
InternetExplorerDriverService.Builder
146
> {
147
public Builder withLogLevel(InternetExplorerDriverLogLevel logLevel);
148
public Builder withHost(String host);
149
public Builder withExtractPath(File extractPath);
150
public Builder withSilent(Boolean silent);
151
}
152
}
153
```
154
155
[Service Management](./service.md)
156
157
## Types
158
159
```java { .api }
160
// Log level enumeration
161
public enum InternetExplorerDriverLogLevel {
162
TRACE, DEBUG, INFO, WARN, ERROR, FATAL
163
}
164
165
// Element scroll behavior options
166
public enum ElementScrollBehavior {
167
TOP(0), BOTTOM(1);
168
169
public int getValue();
170
public static ElementScrollBehavior fromString(String text);
171
}
172
173
// Driver metadata and factory
174
public class InternetExplorerDriverInfo implements WebDriverInfo {
175
public String getDisplayName();
176
public Capabilities getCanonicalCapabilities();
177
public boolean isSupporting(Capabilities capabilities);
178
public boolean isSupportingCdp();
179
public boolean isSupportingBiDi();
180
public boolean isAvailable();
181
public boolean isPresent();
182
public int getMaximumSimultaneousSessions();
183
public Optional<WebDriver> createDriver(Capabilities capabilities);
184
}
185
```
186
187
## Error Handling
188
189
The IE driver throws specific exceptions for common error conditions:
190
191
- **WebDriverException**: General driver errors, platform compatibility issues
192
- **SessionNotCreatedException**: When IE session cannot be created
193
- **Platform-specific errors**: When running on non-Windows platforms
194
195
## Security Considerations
196
197
Internet Explorer has specific security requirements that may affect automation:
198
199
- **Protected Mode**: May require `introduceFlakinessByIgnoringSecurityDomains()` option (not recommended)
200
- **Security Zones**: Different zones may have different automation behavior
201
- **Administrator Privileges**: Some operations may require elevated permissions
202
- **Browser Configuration**: Zoom level and security settings can affect automation reliability