Class DriverCommandExecutor
- java.lang.Object
-
- org.openqa.selenium.remote.HttpCommandExecutor
-
- org.openqa.selenium.remote.service.DriverCommandExecutor
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,org.openqa.selenium.logging.NeedsLocalLogs,CommandExecutor
public class DriverCommandExecutor extends HttpCommandExecutor implements java.io.Closeable
A specializedHttpCommandExecutorthat will use aDriverServicethat lives and dies with a single WebDriver session. The service will be restarted upon each new session request and shutdown after each quit command.
-
-
Constructor Summary
Constructors Constructor Description DriverCommandExecutor(DriverService service)Creates a new DriverCommandExecutor which will communicate with the driver as configured by the givenservice.DriverCommandExecutor(DriverService service, java.util.Map<java.lang.String,CommandInfo> additionalCommands, org.openqa.selenium.remote.http.ClientConfig clientConfig)Creates anDriverCommandExecutorthat supports non-standardadditionalCommandsin addition to the standard.DriverCommandExecutor(DriverService service, org.openqa.selenium.remote.http.ClientConfig clientConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Responseexecute(Command command)Sends thecommandto the driver server for execution.-
Methods inherited from class org.openqa.selenium.remote.HttpCommandExecutor
defineCommand, getAddressOfRemoteServer, getDefaultClientFactory, setLocalLogs
-
-
-
-
Constructor Detail
-
DriverCommandExecutor
public DriverCommandExecutor(DriverService service)
Creates a new DriverCommandExecutor which will communicate with the driver as configured by the givenservice.- Parameters:
service- The DriverService to send commands to.
-
DriverCommandExecutor
public DriverCommandExecutor(DriverService service, org.openqa.selenium.remote.http.ClientConfig clientConfig)
-
DriverCommandExecutor
public DriverCommandExecutor(DriverService service, java.util.Map<java.lang.String,CommandInfo> additionalCommands, org.openqa.selenium.remote.http.ClientConfig clientConfig)
Creates anDriverCommandExecutorthat supports non-standardadditionalCommandsin addition to the standard.- Parameters:
service- driver serveradditionalCommands- additional commands the remote end can processclientConfig-
-
-
Method Detail
-
execute
public Response execute(Command command) throws java.io.IOException
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:
java.io.IOException- If an I/O error occurs while sending the command.
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-