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
serviceDriverServiceThe DriverService that drives the browser.
commandExecutorHttpCommandExecutorThe HttpCommandExecutor object used to execute commands, communicating with the service via HTTP.
Exceptions
- ArgumentNullException
If
serviceorcommandExecutorare null.
DriverServiceCommandExecutor(DriverService, TimeSpan)
Initializes a new instance of the DriverServiceCommandExecutor class.
public DriverServiceCommandExecutor(DriverService driverService, TimeSpan commandTimeout)
Parameters
driverServiceDriverServiceThe DriverService that drives the browser.
commandTimeoutTimeSpanThe maximum amount of time to wait for each command.
Exceptions
- ArgumentNullException
If
driverServiceis null.
DriverServiceCommandExecutor(DriverService, TimeSpan, bool)
Initializes a new instance of the DriverServiceCommandExecutor class.
public DriverServiceCommandExecutor(DriverService driverService, TimeSpan commandTimeout, bool enableKeepAlive)
Parameters
driverServiceDriverServiceThe DriverService that drives the browser.
commandTimeoutTimeSpanThe maximum amount of time to wait for each command.
enableKeepAlivebooltrue if the KeepAlive header should be sent with HTTP requests; otherwise, false.
Exceptions
- ArgumentNullException
If
driverServiceis 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
commandToExecuteCommandThe command you wish to execute
Returns
- Response
A response from the browser
Exceptions
- ArgumentNullException
If
commandToExecuteis null.
ExecuteAsync(Command)
Executes a command as an asynchronous task.
public Task<Response> ExecuteAsync(Command commandToExecute)
Parameters
commandToExecuteCommandThe command you wish to execute
Returns
Exceptions
- ArgumentNullException
If
commandToExecuteis null.
TryAddCommand(string, CommandInfo?)
Gets the CommandInfoRepository object associated with this executor.
public bool TryAddCommand(string commandName, CommandInfo? info)
Parameters
commandNamestringinfoCommandInfo