Class DriverCommandExecutor
java.lang.Object
org.openqa.selenium.remote.HttpCommandExecutor
org.openqa.selenium.remote.service.DriverCommandExecutor
- All Implemented Interfaces:
Closeable,AutoCloseable,NeedsLocalLogs,CommandExecutor
- Direct Known Subclasses:
ChromiumDriverCommandExecutor
A specialized
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.-
Field Summary
Fields inherited from class org.openqa.selenium.remote.HttpCommandExecutor
client, commandCodec, responseCodec -
Constructor Summary
ConstructorsConstructorDescriptionDriverCommandExecutor(DriverService service) Creates a new DriverCommandExecutor which will communicate with the driver as configured by the givenservice.DriverCommandExecutor(DriverService service, Map<String, CommandInfo> additionalCommands, ClientConfig clientConfig) Creates anDriverCommandExecutorthat supports non-standardadditionalCommandsin addition to the standard.DriverCommandExecutor(DriverService service, ClientConfig clientConfig) -
Method Summary
Methods inherited from class org.openqa.selenium.remote.HttpCommandExecutor
addAdditionalCommand, defineCommand, getAdditionalCommands, getAddressOfRemoteServer, getDefaultClientFactory, setLocalLogs
-
Constructor Details
-
DriverCommandExecutor
Creates a new DriverCommandExecutor which will communicate with the driver as configured by the givenservice.- Parameters:
service- The DriverService to send commands to.
-
DriverCommandExecutor
-
DriverCommandExecutor
public DriverCommandExecutor(DriverService service, Map<String, CommandInfo> additionalCommands, ClientConfig clientConfig) Creates anDriverCommandExecutorthat supports non-standardadditionalCommandsin addition to the standard.- Parameters:
service- driver serveradditionalCommands- additional commands the remote end can processclientConfig-
-
-
Method Details
-
execute
Sends thecommandto 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.- Specified by:
executein interfaceCommandExecutor- Overrides:
executein classHttpCommandExecutor- Parameters:
command- The command to execute.- Returns:
- The command response.
- Throws:
IOException- If an I/O error occurs while sending the command.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-