org.openqa.selenium.chrome
Class ChromeBinary

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

public class ChromeBinary
extends java.lang.Object


Field Summary
protected  java.lang.String chromeBinaryLocation
           
 
Constructor Summary
ChromeBinary(ChromeProfile profile, ChromeExtension extension)
           
ChromeBinary(ChromeProfile profile, ChromeExtension extension, int port)
          Creates a new instance for managing an instance of Chrome using the given profile and extension.
 
Method Summary
 void addCustomBinaryFlag(java.lang.String flag)
           
protected  java.lang.String getChromeBinaryLocation()
          Locates the Chrome executable on the current platform.
protected static java.lang.String getDefaultWindowsBinaryLocation()
           
 ChromeExtension getExtension()
           
 int getPort()
           
 ChromeProfile getProfile()
           
protected static java.lang.String getWindowsBinaryLocationFromRegistry()
          Returns null if couldn't read value from registry
 void incrementBackoffBy(int diff)
           
protected  boolean isChromeBinaryLocationKnown()
           
 boolean isRunning()
           
 void kill()
          Kills the Chrome process managed by this instance.
 void setPort(int port)
           
 void start()
          Starts the Chrome process for WebDriver.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chromeBinaryLocation

protected java.lang.String chromeBinaryLocation
Constructor Detail

ChromeBinary

public ChromeBinary(ChromeProfile profile,
                    ChromeExtension extension)
Parameters:
profile - The Chrome profile to use.
extension - The extension to launch Chrome with.
Throws:
WebDriverException - If an error occurs locating the Chrome executable.
See Also:
ChromeBinary(ChromeProfile, ChromeExtension, int)

ChromeBinary

public ChromeBinary(ChromeProfile profile,
                    ChromeExtension extension,
                    int port)
Creates a new instance for managing an instance of Chrome using the given profile and extension.

Parameters:
profile - The Chrome profile to use.
extension - The extension to launch Chrome with.
port - Which port to start Chrome on, or 0 for any free port.
Throws:
WebDriverException - If an error occurs locating the Chrome executable.
Method Detail

addCustomBinaryFlag

public void addCustomBinaryFlag(java.lang.String flag)

getProfile

public ChromeProfile getProfile()

getExtension

public ChromeExtension getExtension()

getPort

public int getPort()

setPort

public void setPort(int port)

start

public void start()
Starts the Chrome process for WebDriver.


isRunning

public boolean isRunning()
Returns:
Whether the Chrome process managed by this instance is still running.

kill

public void kill()
Kills the Chrome process managed by this instance.


incrementBackoffBy

public void incrementBackoffBy(int diff)

getChromeBinaryLocation

protected java.lang.String getChromeBinaryLocation()
                                            throws java.io.IOException
Locates the Chrome executable on the current platform. First looks in the webdriver.chrome.bin property, then searches through the default expected locations.

Returns:
chrome.exe
Throws:
java.io.IOException - if file could not be found/accessed

isChromeBinaryLocationKnown

protected boolean isChromeBinaryLocationKnown()

getWindowsBinaryLocationFromRegistry

protected static final java.lang.String getWindowsBinaryLocationFromRegistry()
Returns null if couldn't read value from registry


getDefaultWindowsBinaryLocation

protected static final java.lang.String getDefaultWindowsBinaryLocation()


Copyright © 2011. All Rights Reserved.