Class InternetExplorerOptions
Class to manage options specific to InternetExplorerDriver
public class InternetExplorerOptions
- 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()
public InternetExplorerOptions()
Properties
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
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
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
EnableNativeEvents
Gets or sets a value indicating whether to use native events in interacting with elements.
public bool EnableNativeEvents { get; set; }
Property Value
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
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
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
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
IgnoreZoomLevel
Gets or sets a value indicating whether to ignore the zoom level of Internet Explorer .
public bool IgnoreZoomLevel { get; set; }
Property Value
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
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
PageLoadStrategy
Gets or sets the value for describing how the browser is to wait for pages to load in the IE driver. Defaults to Default.
public InternetExplorerPageLoadStrategy PageLoadStrategy { get; set; }
Property Value
Proxy
Gets or sets the Proxy to be used with Internet Explorer. By default, will install the specified proxy to be the system proxy, used by all instances of Internet Explorer. To change this default behavior, change the UsePerProcessProxy property.
public Proxy Proxy { get; set; }
Property Value
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
UnexpectedAlertBehavior
Gets or sets the value for describing how unexpected alerts are to be handled in the IE driver. Defaults to Default.
public InternetExplorerUnexpectedAlertBehavior UnexpectedAlertBehavior { get; set; }
Property Value
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
ValidateCookieDocumentType
Gets or sets a value indicating whether to validate the document type of the loaded document when setting cookies.
public bool ValidateCookieDocumentType { get; set; }
Property Value
Methods
AddAdditionalCapability(string, object)
Provides a means to add additional capabilities not yet added as type safe options for the Internet Explorer driver.
public void AddAdditionalCapability(string capabilityName, object capabilityValue)
Parameters
capabilityName
stringThe name of the capability to add.
capabilityValue
objectThe value of the capability to add.
Remarks
Calling AddAdditionalCapability(string, object) where capabilityName
has already been added will overwrite the existing value with the new value in capabilityValue
Exceptions
- ArgumentException
thrown when attempting to add a capability for which there is already a type safe option, or when
capabilityName
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 ICapabilities ToCapabilities()
Returns
- ICapabilities
The DesiredCapabilities for IE with these options.