Class DriverServiceCommandExecutor
Provides a mechanism to execute commands on the browser
public class DriverServiceCommandExecutor : ICommandExecutor, IDisposable
- Inheritance
-
DriverServiceCommandExecutor
- Implements
- Inherited Members
Constructors
DriverServiceCommandExecutor(DriverService, HttpCommandExecutor)
Initializes a new instance of the DriverServiceCommandExecutor class.
public DriverServiceCommandExecutor(DriverService service, HttpCommandExecutor commandExecutor)
Parameters
service
DriverServiceThe DriverService that drives the browser.
commandExecutor
HttpCommandExecutorThe HttpCommandExecutor object used to execute commands, communicating with the service via HTTP.
Exceptions
- ArgumentNullException
If
service
orcommandExecutor
are null.
DriverServiceCommandExecutor(DriverService, TimeSpan)
Initializes a new instance of the DriverServiceCommandExecutor class.
public DriverServiceCommandExecutor(DriverService driverService, TimeSpan commandTimeout)
Parameters
driverService
DriverServiceThe DriverService that drives the browser.
commandTimeout
TimeSpanThe maximum amount of time to wait for each command.
Exceptions
- ArgumentNullException
If
driverService
is null.
DriverServiceCommandExecutor(DriverService, TimeSpan, bool)
Initializes a new instance of the DriverServiceCommandExecutor class.
public DriverServiceCommandExecutor(DriverService driverService, TimeSpan commandTimeout, bool enableKeepAlive)
Parameters
driverService
DriverServiceThe DriverService that drives the browser.
commandTimeout
TimeSpanThe maximum amount of time to wait for each command.
enableKeepAlive
booltrue if the KeepAlive header should be sent with HTTP requests; otherwise, false.
Exceptions
- ArgumentNullException
If
driverService
is null.
Properties
HttpExecutor
Gets the HttpCommandExecutor that sends commands to the remote end WebDriver implementation.
public HttpCommandExecutor HttpExecutor { get; }
Property Value
Methods
Dispose()
Releases all resources used by the DriverServiceCommandExecutor.
public void Dispose()
Dispose(bool)
Releases the unmanaged resources used by the HttpCommandExecutor and optionally releases the managed resources.
protected virtual void Dispose(bool disposing)
Parameters
Execute(Command)
Executes a command
public Response Execute(Command commandToExecute)
Parameters
commandToExecute
CommandThe command you wish to execute
Returns
- Response
A response from the browser
ExecuteAsync(Command)
Executes a command as an asynchronous task.
public Task<Response> ExecuteAsync(Command commandToExecute)
Parameters
commandToExecute
CommandThe command you wish to execute
Returns
TryAddCommand(string, CommandInfo)
Gets the CommandInfoRepository object associated with this executor.
public bool TryAddCommand(string commandName, CommandInfo info)
Parameters
commandName
stringinfo
CommandInfo