Table of Contents

Class InternetExplorerOptions

Namespace
OpenQA.Selenium.IE
Assembly
WebDriver.dll

Class to manage options specific to InternetExplorerDriver

public class InternetExplorerOptions : DriverOptions
Inheritance
InternetExplorerOptions
Inherited Members

Examples

InternetExplorerOptions options = new InternetExplorerOptions();
options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;

For use with InternetExplorerDriver:

InternetExplorerDriver driver = new InternetExplorerDriver(options);

For use with RemoteWebDriver:

RemoteWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), options.ToCapabilities());

Constructors

InternetExplorerOptions()

Initializes a new instance of the InternetExplorerOptions class.

public InternetExplorerOptions()

Fields

Capability

Gets the name of the capability used to store IE options in an ICapabilities object.

public static readonly string Capability

Field Value

string

Properties

AttachToEdgeChrome

Gets or sets a value indicating whether to attach to Edge Chrome browser.

public bool AttachToEdgeChrome { get; set; }

Property Value

bool

BrowserAttachTimeout

Gets or sets the amount of time the driver will attempt to look for a newly launched instance of Internet Explorer.

public TimeSpan BrowserAttachTimeout { get; set; }

Property Value

TimeSpan

BrowserCommandLineArguments

Gets or sets the command line arguments used in launching Internet Explorer when the Windows CreateProcess API is used. This property only has an effect when the ForceCreateProcessApi is true.

public string BrowserCommandLineArguments { get; set; }

Property Value

string

EdgeExecutablePath

Gets or sets the path to the Edge Browser Executable.

public string EdgeExecutablePath { get; set; }

Property Value

string

ElementScrollBehavior

Gets or sets the value for describing how elements are scrolled into view in the IE driver. Defaults to scrolling the element to the top of the viewport.

public InternetExplorerElementScrollBehavior ElementScrollBehavior { get; set; }

Property Value

InternetExplorerElementScrollBehavior

EnableNativeEvents

Gets or sets a value indicating whether to use native events in interacting with elements.

public bool EnableNativeEvents { get; set; }

Property Value

bool

EnablePersistentHover

Gets or sets a value indicating whether to enable persistently sending WM_MOUSEMOVE messages to the IE window during a mouse hover.

public bool EnablePersistentHover { get; set; }

Property Value

bool

EnsureCleanSession

Gets or sets a value indicating whether to clear the Internet Explorer cache before launching the browser. When set to true, clears the system cache for all instances of Internet Explorer, even those already running when the driven instance is launched. Defaults to false.

public bool EnsureCleanSession { get; set; }

Property Value

bool

FileUploadDialogTimeout

Gets or sets the amount of time the driver will attempt to look for the file selection dialog when attempting to upload a file.

public TimeSpan FileUploadDialogTimeout { get; set; }

Property Value

TimeSpan

ForceCreateProcessApi

Gets or sets a value indicating whether to force the use of the Windows CreateProcess API when launching Internet Explorer. The default value is false.

public bool ForceCreateProcessApi { get; set; }

Property Value

bool

ForceShellWindowsApi

Gets or sets a value indicating whether to force the use of the Windows ShellWindows API when attaching to Internet Explorer. The default value is false.

public bool ForceShellWindowsApi { get; set; }

Property Value

bool

IgnoreProcessMatch

Gets or sets a value indicating whether to ignore process id match with IE Mode on Edge.

public bool IgnoreProcessMatch { get; set; }

Property Value

bool

IgnoreZoomLevel

Gets or sets a value indicating whether to ignore the zoom level of Internet Explorer .

public bool IgnoreZoomLevel { get; set; }

Property Value

bool

InitialBrowserUrl

Gets or sets the initial URL displayed when IE is launched. If not set, the browser launches with the internal startup page for the WebDriver server.

public string InitialBrowserUrl { get; set; }

Property Value

string

Remarks

By setting the IntroduceInstabilityByIgnoringProtectedModeSettings to true and this property to a correct URL, you can launch IE in the Internet Protected Mode zone. This can be helpful to avoid the flakiness introduced by ignoring the Protected Mode settings. Nevertheless, setting Protected Mode zone settings to the same value in the IE configuration is the preferred method.

IntroduceInstabilityByIgnoringProtectedModeSettings

Gets or sets a value indicating whether to ignore the settings of the Internet Explorer Protected Mode.

public bool IntroduceInstabilityByIgnoringProtectedModeSettings { get; set; }

Property Value

bool

LegacyFileUploadDialogHanlding

Gets or sets a value indicating whether to use the legacy handling for file upload dialogs.

public bool LegacyFileUploadDialogHanlding { get; set; }

Property Value

bool

RequireWindowFocus

Gets or sets a value indicating whether to require the browser window to have focus before interacting with elements.

public bool RequireWindowFocus { get; set; }

Property Value

bool

UsePerProcessProxy

Gets or sets a value indicating whether to use the supplied Proxy settings on a per-process basis, not updating the system installed proxy setting. This property is only valid when setting a Proxy, where the Kind property is either Direct, System, or Manual, and is otherwise ignored. Defaults to false.

public bool UsePerProcessProxy { get; set; }

Property Value

bool

Methods

AddAdditionalInternetExplorerOption(string, object)

Provides a means to add additional capabilities not yet added as type safe options for the Internet Explorer driver.

public void AddAdditionalInternetExplorerOption(string optionName, object optionValue)

Parameters

optionName string

The name of the capability to add.

optionValue object

The value of the capability to add.

Remarks

Calling AddAdditionalInternetExplorerOption(string, object) where optionName has already been added will overwrite the existing value with the new value in optionValue. Calling this method adds capabilities to the IE-specific options object passed to IEDriverServer.exe (property name 'se:ieOptions').

Exceptions

ArgumentException

thrown when attempting to add a capability for which there is already a type safe option, or when optionName is null or the empty string.

ToCapabilities()

Returns DesiredCapabilities for IE with these options included as capabilities. This copies the options. Further changes will not be reflected in the returned capabilities.

public override ICapabilities ToCapabilities()

Returns

ICapabilities

The DesiredCapabilities for IE with these options.