org.openqa.selenium.firefox
Class FirefoxDriver

java.lang.Object
  extended by org.openqa.selenium.remote.RemoteWebDriver
      extended by org.openqa.selenium.firefox.FirefoxDriver
All Implemented Interfaces:
FindsByClassName, FindsByCssSelector, FindsById, FindsByLinkText, FindsByName, FindsByTagName, FindsByXPath, JavascriptExecutor, SearchContext, TakesScreenshot, WebDriver

public class FirefoxDriver
extends RemoteWebDriver
implements TakesScreenshot, FindsByCssSelector

An implementation of the {#link WebDriver} interface that drives Firefox. This works through a firefox extension, which gets installed automatically if necessary. Important system variables are:

When the driver starts, it will make a copy of the profile it is using, rather than using that profile directly. This allows multiple instances of firefox to be started.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.openqa.selenium.remote.RemoteWebDriver
RemoteWebDriver.RemoteTargetLocator, RemoteWebDriver.RemoteTimeouts
 
Nested classes/interfaces inherited from interface org.openqa.selenium.WebDriver
WebDriver.Navigation, WebDriver.Options, WebDriver.TargetLocator, WebDriver.Timeouts
 
Field Summary
static boolean ACCEPT_UNTRUSTED_CERTIFICATES
           
static boolean ASSUME_UNTRUSTED_ISSUER
           
protected  FirefoxBinary binary
           
static java.lang.String BINARY
           
static boolean DEFAULT_ENABLE_NATIVE_EVENTS
           
static int DEFAULT_PORT
           
static java.lang.String PROFILE
           
 
Fields inherited from class org.openqa.selenium.remote.RemoteWebDriver
clientProcess
 
Constructor Summary
FirefoxDriver()
           
FirefoxDriver(Capabilities capabilities)
           
FirefoxDriver(FirefoxBinary binary, FirefoxProfile profile)
           
FirefoxDriver(FirefoxProfile profile)
           
 
Method Summary
protected  ExtensionConnection connectTo(FirefoxBinary binary, FirefoxProfile profile, java.lang.String host)
           
protected  Response execute(java.lang.String driverCommand, java.util.Map<java.lang.String,?> parameters)
           
 WebElement findElementByCssSelector(java.lang.String using)
           
 java.util.List<WebElement> findElementsByCssSelector(java.lang.String using)
           
<X> X
getScreenshotAs(OutputType<X> target)
           
 boolean isJavascriptEnabled()
           
protected  FirefoxWebElement newRemoteWebElement()
           
 void saveScreenshot(java.io.File pngFile)
          Deprecated. Use getScreenshotAs(file), which returns a temporary file.
protected  void startClient()
           
protected  void stopClient()
           
 WebDriver.TargetLocator switchTo()
           
 
Methods inherited from class org.openqa.selenium.remote.RemoteWebDriver
close, execute, executeScript, findElement, findElement, findElementByClassName, findElementById, findElementByLinkText, findElementByName, findElementByPartialLinkText, findElementByTagName, findElementByXPath, findElements, findElements, findElementsByClassName, findElementsById, findElementsByLinkText, findElementsByName, findElementsByPartialLinkText, findElementsByTagName, findElementsByXPath, get, getCapabilities, getCommandExecutor, getCurrentUrl, getErrorHandler, getPageSource, getTitle, getWindowHandle, getWindowHandles, manage, navigate, quit, setElementConverter, startSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BINARY

public static final java.lang.String BINARY
See Also:
Constant Field Values

PROFILE

public static final java.lang.String PROFILE
See Also:
Constant Field Values

DEFAULT_PORT

public static final int DEFAULT_PORT
See Also:
Constant Field Values

DEFAULT_ENABLE_NATIVE_EVENTS

public static final boolean DEFAULT_ENABLE_NATIVE_EVENTS

ACCEPT_UNTRUSTED_CERTIFICATES

public static final boolean ACCEPT_UNTRUSTED_CERTIFICATES
See Also:
Constant Field Values

ASSUME_UNTRUSTED_ISSUER

public static final boolean ASSUME_UNTRUSTED_ISSUER
See Also:
Constant Field Values

binary

protected FirefoxBinary binary
Constructor Detail

FirefoxDriver

public FirefoxDriver()

FirefoxDriver

public FirefoxDriver(FirefoxProfile profile)

FirefoxDriver

public FirefoxDriver(Capabilities capabilities)

FirefoxDriver

public FirefoxDriver(FirefoxBinary binary,
                     FirefoxProfile profile)
Method Detail

startClient

protected void startClient()
Overrides:
startClient in class RemoteWebDriver

connectTo

protected ExtensionConnection connectTo(FirefoxBinary binary,
                                        FirefoxProfile profile,
                                        java.lang.String host)

stopClient

protected void stopClient()
Overrides:
stopClient in class RemoteWebDriver

newRemoteWebElement

protected FirefoxWebElement newRemoteWebElement()
Overrides:
newRemoteWebElement in class RemoteWebDriver

findElementByCssSelector

public WebElement findElementByCssSelector(java.lang.String using)
Specified by:
findElementByCssSelector in interface FindsByCssSelector

findElementsByCssSelector

public java.util.List<WebElement> findElementsByCssSelector(java.lang.String using)
Specified by:
findElementsByCssSelector in interface FindsByCssSelector

switchTo

public WebDriver.TargetLocator switchTo()
Specified by:
switchTo in interface WebDriver
Overrides:
switchTo in class RemoteWebDriver

execute

protected Response execute(java.lang.String driverCommand,
                           java.util.Map<java.lang.String,?> parameters)
Overrides:
execute in class RemoteWebDriver

isJavascriptEnabled

public boolean isJavascriptEnabled()
Specified by:
isJavascriptEnabled in interface JavascriptExecutor
Overrides:
isJavascriptEnabled in class RemoteWebDriver

getScreenshotAs

public <X> X getScreenshotAs(OutputType<X> target)
Specified by:
getScreenshotAs in interface TakesScreenshot

saveScreenshot

@Deprecated
public void saveScreenshot(java.io.File pngFile)
Deprecated. Use getScreenshotAs(file), which returns a temporary file.

Saves a screenshot of the current page into the given file.



Copyright © 2010. All Rights Reserved.