public abstract static class DriverService.Builder<DS extends DriverService,B extends DriverService.Builder<?,?>>
extends java.lang.Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
DS |
build()
Creates a new service to manage the driver server.
|
protected abstract com.google.common.collect.ImmutableList<java.lang.String> |
createArgs() |
protected abstract DS |
createDriverService(java.io.File exe,
int port,
com.google.common.collect.ImmutableList<java.lang.String> args,
com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> environment) |
protected abstract java.io.File |
findDefaultExecutable() |
protected java.io.File |
getLogFile() |
protected int |
getPort() |
abstract int |
score(org.openqa.selenium.Capabilities capabilites)
Provides a measure of how strongly this
DriverService supports the given
capabilities. |
B |
usingAnyFreePort()
Configures the driver server to start on any available port.
|
B |
usingDriverExecutable(java.io.File file)
Sets which driver executable the builder will use.
|
B |
usingPort(int port)
Sets which port the driver server should be started on.
|
B |
withEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
Defines the environment for the launched driver server.
|
B |
withLogFile(java.io.File logFile)
Configures the driver server to write log to the given file.
|
public abstract int score(org.openqa.selenium.Capabilities capabilites)
DriverService supports the given
capabilities. A score of 0 or less indicates that this DriverService does not
support instances of WebDriver that require capabilities.
Typically, the score is generated by summing the number of capabilities that the driver
service directly supports that are unique to the driver service (that is, things like
"proxy" don't tend to count to the score).public B usingDriverExecutable(java.io.File file)
file - The executable to use.public B usingPort(int port)
port - The port to use; must be non-negative.protected int getPort()
public B usingAnyFreePort()
@Beta public B withEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
environment - A map of the environment variables to launch the
server with.public B withLogFile(java.io.File logFile)
logFile - A file to write log to.protected java.io.File getLogFile()
public DS build()
protected abstract java.io.File findDefaultExecutable()
protected abstract com.google.common.collect.ImmutableList<java.lang.String> createArgs()
protected abstract DS createDriverService(java.io.File exe, int port, com.google.common.collect.ImmutableList<java.lang.String> args, com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> environment)