org.openqa.selenium.chrome
Class ChromeExtension

java.lang.Object
  extended by org.openqa.selenium.chrome.ChromeExtension

public class ChromeExtension
extends java.lang.Object

Class for managing the WebDriver Chrome extension.

Author:
[email protected] (Jason Leyba)

Field Summary
static java.lang.String CHROME_EXTENSION_DIRECTORY_PROPERTY
          System property used to specify which extension directory to use.
 
Constructor Summary
ChromeExtension()
          Creates a new instance using the directory specified by the criteria defined by findChromeExtensionDir().
ChromeExtension(java.io.File directory)
          Create a new instance that manages the extension in the specified directory.
 
Method Summary
static java.io.File findChromeExtensionDir()
          Searches for the Chrome extension directory to use.
 java.io.File getDirectory()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHROME_EXTENSION_DIRECTORY_PROPERTY

public static final java.lang.String CHROME_EXTENSION_DIRECTORY_PROPERTY
System property used to specify which extension directory to use.

See Also:
Constant Field Values
Constructor Detail

ChromeExtension

public ChromeExtension(java.io.File directory)
                throws WebDriverException
Create a new instance that manages the extension in the specified directory. Assumes that the directory exists and has the required files.

Parameters:
directory - The directory to use as the Chrome extension.
Throws:
WebDriverException - If the directory is not valid (e.g. does not contain a manifest.json file).

ChromeExtension

public ChromeExtension()
Creates a new instance using the directory specified by the criteria defined by findChromeExtensionDir().

See Also:
ChromeExtension(File), findChromeExtensionDir()
Method Detail

getDirectory

public java.io.File getDirectory()

findChromeExtensionDir

public static java.io.File findChromeExtensionDir()
Searches for the Chrome extension directory to use. Will first check the directory specified by the webdriver.chrome.extensiondir system property, and then will check the current classpath for chrome-extension.zip.

Returns:
The Chrome extension directory.


Copyright © 2010. All Rights Reserved.