C# Class OpenQA.Selenium.IE.InternetExplorerDriver

Provides a way to access Internet Explorer to run your tests by creating a InternetExplorerDriver instance
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.
Inheritance: IWebDriver, ISearchContext, IJavaScriptExecutor, ITakesScreenshot
显示文件 Open project: epall/selenium Class Usage Examples

Public Methods

Method Description
Close ( ) : void

Closes the Browser.

Dispose ( ) : void

Disposes of all unmanaged instances of InternetExplorerDriver.

ExecuteScript ( string script ) : object

Executes JavaScript in the context of the currently selected frame or window.

The ExecuteScriptmethod executes JavaScript in the context of the currently selected frame or window. This means that "document" will refer to the current document. If the script has a return value, then the following steps will be taken:

For an HTML element, this method returns a IWebElement For a number, a System.Int64 is returned For a boolean, a System.Boolean is returned For all other cases a System.String is returned. For an array,we check the first element, and attempt to return a List{T} of that type, following the rules above. Nested lists are not supported. If the value is null or there is no return value, is returned.

Arguments must be a number (which will be converted to a System.Int64), a System.Boolean, a System.String or a IWebElement. An exception will be thrown if the arguments do not meet these criteria. The arguments will be made available to the JavaScript via the "arguments" magic variable, as if the function were called via "Function.apply"

FindElement ( By by ) : IWebElement

Finds the first element in the page that matches the By object.

FindElements ( By by ) : ReadOnlyCollection

Finds the elements on the page by using the By object and returns a ReadOnlyCollection of the Elements on the page.

GetScreenshot ( ) : Screenshot

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

GetWindowHandle ( ) : string

Returns the Name of Window that the driver is working in.

GetWindowHandles ( ) : ReadOnlyCollection

Method for returning a collection of WindowHandles that the driver has access to.

InternetExplorerDriver ( ) : System

Initializes a new instance of the InternetExplorerDriver class.

Manage ( ) : IOptions

Method For getting an object to set the Speed.

Navigate ( ) : INavigation

Method to allow you to Navigate with WebDriver.

Quit ( ) : void

Close the Browser and Dispose of WebDriver.

SwitchTo ( ) : ITargetLocator

Method to give you access to switch frames and windows.

Private Methods

Method Description
ExtractReturnValue ( SafeScriptResultHandle scriptResult ) : object
GetUnderlayingHandle ( ) : SafeInternetExplorerDriverHandle

Get the driver handle.

PopulateArguments ( SafeScriptArgsHandle scriptArgs, object args ) : WebDriverResult
WaitForLoadToComplete ( ) : void

Wait for the load to complete.

Method Details

Close() public method

Closes the Browser.
public Close ( ) : void
return void

Dispose() public method

Disposes of all unmanaged instances of InternetExplorerDriver.
public Dispose ( ) : void
return void

ExecuteScript() public method

Executes JavaScript in the context of the currently selected frame or window.

The ExecuteScriptmethod executes JavaScript in the context of the currently selected frame or window. This means that "document" will refer to the current document. If the script has a return value, then the following steps will be taken:

For an HTML element, this method returns a IWebElement For a number, a System.Int64 is returned For a boolean, a System.Boolean is returned For all other cases a System.String is returned. For an array,we check the first element, and attempt to return a List{T} of that type, following the rules above. Nested lists are not supported. If the value is null or there is no return value, is returned.

Arguments must be a number (which will be converted to a System.Int64), a System.Boolean, a System.String or a IWebElement. An exception will be thrown if the arguments do not meet these criteria. The arguments will be made available to the JavaScript via the "arguments" magic variable, as if the function were called via "Function.apply"

public ExecuteScript ( string script ) : object
script string The JavaScript code to execute.
return object

FindElement() public method

Finds the first element in the page that matches the By object.
public FindElement ( By by ) : IWebElement
by By By mechanism for finding the element.
return IWebElement

FindElements() public method

Finds the elements on the page by using the By object and returns a ReadOnlyCollection of the Elements on the page.
public FindElements ( By by ) : ReadOnlyCollection
by By By mechanism for finding the element.
return ReadOnlyCollection

GetScreenshot() public method

Gets a Screenshot object representing the image of the page on the screen.
public GetScreenshot ( ) : Screenshot
return Screenshot

GetWindowHandle() public method

Returns the Name of Window that the driver is working in.
public GetWindowHandle ( ) : string
return string

GetWindowHandles() public method

Method for returning a collection of WindowHandles that the driver has access to.
public GetWindowHandles ( ) : ReadOnlyCollection
return ReadOnlyCollection

InternetExplorerDriver() public method

Initializes a new instance of the InternetExplorerDriver class.
public InternetExplorerDriver ( ) : System
return System

Manage() public method

Method For getting an object to set the Speed.
public Manage ( ) : IOptions
return IOptions

Navigate() public method

Method to allow you to Navigate with WebDriver.
public Navigate ( ) : INavigation
return INavigation

Quit() public method

Close the Browser and Dispose of WebDriver.
public Quit ( ) : void
return void

SwitchTo() public method

Method to give you access to switch frames and windows.
public SwitchTo ( ) : ITargetLocator
return ITargetLocator