public class DriverCommandExecutor extends HttpCommandExecutor
HttpCommandExecutor
that will use a DriverService
that lives
and dies with a single WebDriver session. The service will be restarted upon each new session
request and shutdown after each quit command.Modifier and Type | Field and Description |
---|---|
private DriverService |
service |
Modifier | Constructor and Description |
---|---|
|
DriverCommandExecutor(DriverService service)
Creates a new DriverCommandExecutor which will communicate with the driver as configured
by the given
service . |
protected |
DriverCommandExecutor(DriverService service,
java.util.Map<java.lang.String,CommandInfo> additionalCommands)
Creates an
DriverCommandExecutor that supports non-standard
additionalCommands in addition to the standard. |
Modifier and Type | Method and Description |
---|---|
Response |
execute(Command command)
Sends the
command to the driver server for execution. |
defineCommand, getAddressOfRemoteServer, setLocalLogs
private final DriverService service
public DriverCommandExecutor(DriverService service)
service
.service
- The DriverService to send commands to.protected DriverCommandExecutor(DriverService service, java.util.Map<java.lang.String,CommandInfo> additionalCommands)
DriverCommandExecutor
that supports non-standard
additionalCommands
in addition to the standard.service
- driver serveradditionalCommands
- additional commands the remote end can processpublic Response execute(Command command) throws java.io.IOException
command
to the driver server for execution. The server will be started
if requesting a new session. Likewise, if terminating a session, the server will be shutdown
once a response is received.execute
in interface CommandExecutor
execute
in class HttpCommandExecutor
command
- The command to execute.java.io.IOException
- If an I/O error occurs while sending the command.