C# Class OpenQA.Selenium.Firefox.FirefoxDriver

Provides a way to access Firefox to run tests.
When the FirefoxDriver object has been instantiated the browser will load. The test can then navigate to the URL under test and start your test.

In the case of the FirefoxDriver, you can specify a named profile to be used, or you can let the driver create a temporary, anonymous profile. A custom extension allowing the driver to communicate to the browser will be installed into the profile.

Inheritance: OpenQA.Selenium.Remote.RemoteWebDriver, ITakesScreenshot
Exibir arquivo Open project: asynchrony/Selenium2 Class Usage Examples

Public Properties

Property Type Description
AcceptUntrustedCertificates bool
DefaultEnableNativeEvents bool
DefaultPort int

Public Methods

Method Description
FirefoxDriver ( ) : System

Initializes a new instance of the FirefoxDriver class.

FirefoxDriver ( OpenQA.Selenium.Firefox.FirefoxBinary binary, FirefoxProfile profile ) : System

Initializes a new instance of the FirefoxDriver class for a given profile and binary environment.

FirefoxDriver ( OpenQA.Selenium.Firefox.FirefoxBinary binary, FirefoxProfile profile, System.TimeSpan commandTimeout ) : System

Initializes a new instance of the FirefoxDriver class for a given profile, binary environment, and timeout value.

FirefoxDriver ( FirefoxProfile profile ) : System

Initializes a new instance of the FirefoxDriver class for a given profile.

GetScreenshot ( ) : Screenshot

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

Protected Methods

Method Description
CreateElement ( string elementId ) : RemoteWebElement

Creates a RemoteWebElement with the specified ID.

PrepareEnvironment ( ) : void

In derived classes, the PrepareEnvironment method prepares the environment for test execution.

StartClient ( ) : void

Starts the command executor, enabling communication with the browser.

StopClient ( ) : void

Stops the command executor, ending further communication with the browser.

Private Methods

Method Description
CreateExtensionConnection ( OpenQA.Selenium.Firefox.FirefoxBinary binary, FirefoxProfile profile, System.TimeSpan commandTimeout ) : ExtensionConnection

Method Details

CreateElement() protected method

Creates a RemoteWebElement with the specified ID.
protected CreateElement ( string elementId ) : RemoteWebElement
elementId string The ID of this element.
return OpenQA.Selenium.Remote.RemoteWebElement

FirefoxDriver() public method

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

FirefoxDriver() public method

Initializes a new instance of the FirefoxDriver class for a given profile and binary environment.
public FirefoxDriver ( OpenQA.Selenium.Firefox.FirefoxBinary binary, FirefoxProfile profile ) : System
binary OpenQA.Selenium.Firefox.FirefoxBinary A object representing the operating system /// environmental settings used when running Firefox.
profile FirefoxProfile A object representing the profile settings /// to be used in starting Firefox.
return System

FirefoxDriver() public method

Initializes a new instance of the FirefoxDriver class for a given profile, binary environment, and timeout value.
public FirefoxDriver ( OpenQA.Selenium.Firefox.FirefoxBinary binary, FirefoxProfile profile, System.TimeSpan commandTimeout ) : System
binary OpenQA.Selenium.Firefox.FirefoxBinary A object representing the operating system /// environmental settings used when running Firefox.
profile FirefoxProfile A object representing the profile settings /// to be used in starting Firefox.
commandTimeout System.TimeSpan The maximum amount of time to wait for each command.
return System

FirefoxDriver() public method

Initializes a new instance of the FirefoxDriver class for a given profile.
public FirefoxDriver ( FirefoxProfile profile ) : System
profile FirefoxProfile A object representing the profile settings /// to be used in starting Firefox.
return System

GetScreenshot() public method

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

PrepareEnvironment() protected method

In derived classes, the PrepareEnvironment method prepares the environment for test execution.
protected PrepareEnvironment ( ) : void
return void

StartClient() protected method

Starts the command executor, enabling communication with the browser.
protected StartClient ( ) : void
return void

StopClient() protected method

Stops the command executor, ending further communication with the browser.
protected StopClient ( ) : void
return void

Property Details

AcceptUntrustedCertificates public_oe static_oe property

Indicates whether the driver will accept untrusted SSL certificates.
public static bool AcceptUntrustedCertificates
return bool

DefaultEnableNativeEvents public_oe static_oe property

Indicates whether native events is enabled by default for this platform.
public static bool DefaultEnableNativeEvents
return bool

DefaultPort public_oe static_oe property

The default port on which to communicate with the Firefox extension.
public static int DefaultPort
return int