Table of Contents

Class InternetExplorerDriver

Namespace
OpenQA.Selenium.IE
Assembly
WebDriver.dll

Provides a way to access Internet Explorer to run your tests by creating a InternetExplorerDriver instance

public class InternetExplorerDriver : RemoteWebDriver, IWebDriver, IDisposable, ISearchContext, IJavaScriptExecutor, IFindsById, IFindsByClassName, IFindsByLinkText, IFindsByName, IFindsByTagName, IFindsByXPath, IFindsByPartialLinkText, IFindsByCssSelector, IHasInputDevices, IHasCapabilities, IAllowsFileDetection, ITakesScreenshot
Inheritance
InternetExplorerDriver
Implements
Inherited Members

Examples

[TestFixture]
public class Testing
{
    private IWebDriver driver;

    [SetUp]
    public void SetUp()
    {
        driver = new InternetExplorerDriver();
    }

    [Test]
    public void TestGoogle()
    {
        driver.Navigate().GoToUrl("http://www.google.co.uk");
        /*
        *   Rest of the test
        */
    }

    [TearDown]
    public void TearDown()
    {
        driver.Quit();
        driver.Dispose();
    } 
}

Remarks

When the WebDriver object has been instantiated the browser will load. The test can then navigate to the URL under test and start your test.

Constructors

InternetExplorerDriver()

Initializes a new instance of the InternetExplorerDriver class.

public InternetExplorerDriver()

InternetExplorerDriver(InternetExplorerDriverService, InternetExplorerOptions)

Initializes a new instance of the InternetExplorerDriver class using the specified InternetExplorerDriverService and options.

public InternetExplorerDriver(InternetExplorerDriverService service, InternetExplorerOptions options)

Parameters

service InternetExplorerDriverService

The DriverService to use.

options InternetExplorerOptions

The InternetExplorerOptions used to initialize the driver.

InternetExplorerDriver(InternetExplorerDriverService, InternetExplorerOptions, TimeSpan)

Initializes a new instance of the InternetExplorerDriver class using the specified DriverService, InternetExplorerOptions, and command timeout.

public InternetExplorerDriver(InternetExplorerDriverService service, InternetExplorerOptions options, TimeSpan commandTimeout)

Parameters

service InternetExplorerDriverService

The InternetExplorerDriverService to use.

options InternetExplorerOptions

The InternetExplorerOptions used to initialize the driver.

commandTimeout TimeSpan

The maximum amount of time to wait for each command.

InternetExplorerDriver(InternetExplorerOptions)

Initializes a new instance of the InternetExplorerDriver class with the desired options.

public InternetExplorerDriver(InternetExplorerOptions options)

Parameters

options InternetExplorerOptions

The InternetExplorerOptions used to initialize the driver.

InternetExplorerDriver(string)

Initializes a new instance of the InternetExplorerDriver class using the specified path to the directory containing IEDriverServer.exe.

public InternetExplorerDriver(string internetExplorerDriverServerDirectory)

Parameters

internetExplorerDriverServerDirectory string

The full path to the directory containing IEDriverServer.exe.

InternetExplorerDriver(string, InternetExplorerOptions)

Initializes a new instance of the InternetExplorerDriver class using the specified path to the directory containing IEDriverServer.exe and options.

public InternetExplorerDriver(string internetExplorerDriverServerDirectory, InternetExplorerOptions options)

Parameters

internetExplorerDriverServerDirectory string

The full path to the directory containing IEDriverServer.exe.

options InternetExplorerOptions

The InternetExplorerOptions used to initialize the driver.

InternetExplorerDriver(string, InternetExplorerOptions, TimeSpan)

Initializes a new instance of the InternetExplorerDriver class using the specified path to the directory containing IEDriverServer.exe, options, and command timeout.

public InternetExplorerDriver(string internetExplorerDriverServerDirectory, InternetExplorerOptions options, TimeSpan commandTimeout)

Parameters

internetExplorerDriverServerDirectory string

The full path to the directory containing IEDriverServer.exe.

options InternetExplorerOptions

The InternetExplorerOptions used to initialize the driver.

commandTimeout TimeSpan

The maximum amount of time to wait for each command.

Methods

GetScreenshot()

Gets a Screenshot object representing the image of the page on the screen.

public Screenshot GetScreenshot()

Returns

Screenshot

A Screenshot object containing the image.