org.openqa.selenium.chrome
Class ChromeDriver

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

public class ChromeDriver
extends RemoteWebDriver
implements TakesScreenshot


Nested Class Summary
 
Nested classes/interfaces inherited from class org.openqa.selenium.remote.RemoteWebDriver
RemoteWebDriver.RemoteMouse, RemoteWebDriver.RemoteTargetLocator, RemoteWebDriver.RemoteTimeouts, RemoteWebDriver.RemoteWebDriverOptions
 
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
           
 
Constructor Summary
ChromeDriver()
          Starts up a new instance of Chrome, with the required extension loaded, and has it connect to a new ChromeCommandExecutor on its port
ChromeDriver(ChromeBinary binary)
           
ChromeDriver(ChromeProfile profile, ChromeExtension extension)
          Starts up a new instance of Chrome using the specified profile and extension.
 
Method Summary
protected  Response execute(java.lang.String driverCommand, java.util.Map<java.lang.String,?> parameters)
          Executes a passed command using the current ChromeCommandExecutor
<X> X
getScreenshotAs(OutputType<X> target)
           
 boolean isJavascriptEnabled()
           
protected  RemoteWebElement newRemoteWebElement()
           
protected  void startClient()
          By default will try to load Chrome from system property webdriver.chrome.bin and the extension from webdriver.chrome.extensiondir.
protected  void stopClient()
          Kills the started Chrome process and ChromeCommandExecutor if they exist
 
Methods inherited from class org.openqa.selenium.remote.RemoteWebDriver
actionsBuilder, close, execute, executeAsyncScript, executeScript, findElement, findElement, findElementByClassName, findElementByCssSelector, findElementById, findElementByLinkText, findElementByName, findElementByPartialLinkText, findElementByTagName, findElementByXPath, findElements, findElements, findElementsByClassName, findElementsByCssSelector, findElementsById, findElementsByLinkText, findElementsByName, findElementsByPartialLinkText, findElementsByTagName, findElementsByXPath, get, getCapabilities, getCommandExecutor, getCurrentUrl, getElementConverter, getErrorHandler, getKeyboard, getMouse, getPageSource, getSessionId, getTitle, getWindowHandle, getWindowHandles, log, manage, navigate, quit, setCommandExecutor, setElementConverter, startSession, switchTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACCEPT_UNTRUSTED_CERTIFICATES

public static final boolean ACCEPT_UNTRUSTED_CERTIFICATES
See Also:
Constant Field Values
Constructor Detail

ChromeDriver

public ChromeDriver(ChromeBinary binary)

ChromeDriver

public ChromeDriver(ChromeProfile profile,
                    ChromeExtension extension)
Starts up a new instance of Chrome using the specified profile and extension.

Parameters:
profile - The profile to use.
extension - The extension to use.

ChromeDriver

public ChromeDriver()
Starts up a new instance of Chrome, with the required extension loaded, and has it connect to a new ChromeCommandExecutor on its port

See Also:
ChromeDriver(ChromeProfile, ChromeExtension)
Method Detail

startClient

protected void startClient()
By default will try to load Chrome from system property webdriver.chrome.bin and the extension from webdriver.chrome.extensiondir. If the former fails, will try to guess the path to Chrome. If the latter fails, will try to unzip from the JAR we hope we're in. If these fail, throws exceptions.

Overrides:
startClient in class RemoteWebDriver

stopClient

protected void stopClient()
Kills the started Chrome process and ChromeCommandExecutor if they exist

Overrides:
stopClient in class RemoteWebDriver

execute

protected Response execute(java.lang.String driverCommand,
                           java.util.Map<java.lang.String,?> parameters)
Executes a passed command using the current ChromeCommandExecutor

Overrides:
execute in class RemoteWebDriver
Parameters:
driverCommand - command to execute
parameters - parameters of command being executed
Returns:
response to the command (a Response wrapping a null value if none)

isJavascriptEnabled

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

newRemoteWebElement

protected RemoteWebElement newRemoteWebElement()
Overrides:
newRemoteWebElement in class RemoteWebDriver

getScreenshotAs

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


Copyright © 2011. All Rights Reserved.