org.openqa.selenium.chrome
Class ChromeDriver
java.lang.Object
org.openqa.selenium.remote.RemoteWebDriver
org.openqa.selenium.chrome.ChromeDriver
- All Implemented Interfaces:
- FindsByClassName, FindsByCssSelector, FindsById, FindsByLinkText, FindsByName, FindsByTagName, FindsByXPath, JavascriptExecutor, SearchContext, TakesScreenshot, WebDriver
public class ChromeDriver
- extends RemoteWebDriver
- implements TakesScreenshot, FindsByCssSelector
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(ChromeProfile profile,
ChromeExtension extension)
Starts up a new instance of Chrome using the specified profile and
extension. |
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, startSession, switchTo |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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)
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(DriverCommand 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 executeparameters
- 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
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
newRemoteWebElement
protected RemoteWebElement newRemoteWebElement()
- Overrides:
newRemoteWebElement
in class RemoteWebDriver
getScreenshotAs
public <X> X getScreenshotAs(OutputType<X> target)
- Specified by:
getScreenshotAs
in interface TakesScreenshot
Copyright © 2010. All Rights Reserved.