org.openqa.selenium.chrome
Class ChromeDriverService.Builder

java.lang.Object
  extended by org.openqa.selenium.chrome.ChromeDriverService.Builder
Enclosing class:
ChromeDriverService

public static class ChromeDriverService.Builder
extends Object

Builder used to configure new ChromeDriverService instances.


Constructor Summary
ChromeDriverService.Builder()
           
 
Method Summary
 ChromeDriverService build()
          Creates a new service to manage the driver server.
 ChromeDriverService.Builder usingAnyFreePort()
          Configures the driver server to start on any available port.
 ChromeDriverService.Builder usingDriverExecutable(File file)
          Sets which driver executable the builder will use.
 ChromeDriverService.Builder usingPort(int port)
          Sets which port the driver server should be started on.
 ChromeDriverService.Builder withEnvironment(Map<String,String> environment)
          Defines the environment for the launched driver server.
 ChromeDriverService.Builder withLogFile(File logFile)
          Configures the driver server to write log to the given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChromeDriverService.Builder

public ChromeDriverService.Builder()
Method Detail

usingDriverExecutable

public ChromeDriverService.Builder usingDriverExecutable(File file)
Sets which driver executable the builder will use.

Parameters:
file - The executable to use.
Returns:
A self reference.

usingPort

public ChromeDriverService.Builder usingPort(int port)
Sets which port the driver server should be started on. A value of 0 indicates that any free port may be used.

Parameters:
port - The port to use; must be non-negative.
Returns:
A self reference.

usingAnyFreePort

public ChromeDriverService.Builder usingAnyFreePort()
Configures the driver server to start on any available port.

Returns:
A self reference.

withEnvironment

@Beta
public ChromeDriverService.Builder withEnvironment(Map<String,String> environment)
Defines the environment for the launched driver server. These settings will be inherited by every browser session launched by the server.

Parameters:
environment - A map of the environment variables to launch the server with.
Returns:
A self reference.

withLogFile

public ChromeDriverService.Builder withLogFile(File logFile)
Configures the driver server to write log to the given file.

Parameters:
logFile - A file to write log to.
Returns:
A self reference.

build

public ChromeDriverService build()
Creates a new service to manage the driver server. Before creating a new service, the builder will find a port for the server to listen to.

Returns:
The new service object.


Copyright © 2013. All Rights Reserved.