Class InternetExplorerDriver
Provides a way to access Internet Explorer to run your tests by creating a InternetExplorerDriver instance
public class InternetExplorerDriver : WebDriver, IWebDriver, IDisposable, ISearchContext, IJavaScriptExecutor, IFindsElement, ITakesScreenshot, ISupportsPrint, IActionExecutor, IAllowsFileDetection, IHasCapabilities, IHasCommandExecutor, IHasSessionId, ICustomDriverCommandExecutor, IHasVirtualAuthenticator
- Inheritance
-
InternetExplorerDriver
- Implements
- Inherited Members
- Extension Methods
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)
Initializes a new instance of the InternetExplorerDriver class using the specified driver service.
public InternetExplorerDriver(InternetExplorerDriverService service)
Parameters
service
InternetExplorerDriverServiceThe InternetExplorerDriverService used to initialize the driver.
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
InternetExplorerDriverServiceThe DriverService to use.
options
InternetExplorerOptionsThe 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
InternetExplorerDriverServiceThe InternetExplorerDriverService to use.
options
InternetExplorerOptionsThe InternetExplorerOptions used to initialize the driver.
commandTimeout
TimeSpanThe 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
InternetExplorerOptionsThe 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
stringThe 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
stringThe full path to the directory containing IEDriverServer.exe.
options
InternetExplorerOptionsThe 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
stringThe full path to the directory containing IEDriverServer.exe.
options
InternetExplorerOptionsThe InternetExplorerOptions used to initialize the driver.
commandTimeout
TimeSpanThe maximum amount of time to wait for each command.
Properties
FileDetector
Gets or sets the IFileDetector responsible for detecting sequences of keystrokes representing file paths and names.
public override IFileDetector FileDetector { get; set; }
Property Value
Remarks
The IE driver does not allow a file detector to be set, as the server component of the IE driver (IEDriverServer.exe) only allows uploads from the local computer environment. Attempting to set this property has no effect, but does not throw an exception. If you are attempting to run the IE driver remotely, use RemoteWebDriver in conjunction with a standalone WebDriver server.