Class HttpCommandExecutor
Provides a way of executing Commands over HTTP
public class HttpCommandExecutor : ICommandExecutor, IDisposable
- Inheritance
-
HttpCommandExecutor
- Implements
- Inherited Members
Constructors
HttpCommandExecutor(Uri, TimeSpan)
Initializes a new instance of the HttpCommandExecutor class
public HttpCommandExecutor(Uri addressOfRemoteServer, TimeSpan timeout)
Parameters
addressOfRemoteServer
UriAddress of the WebDriver Server
timeout
TimeSpanThe timeout within which the server must respond.
HttpCommandExecutor(Uri, TimeSpan, bool)
Initializes a new instance of the HttpCommandExecutor class
public HttpCommandExecutor(Uri addressOfRemoteServer, TimeSpan timeout, bool enableKeepAlive)
Parameters
addressOfRemoteServer
UriAddress of the WebDriver Server
timeout
TimeSpanThe timeout within which the server must respond.
enableKeepAlive
booltrue if the KeepAlive header should be sent with HTTP requests; otherwise, false.
Exceptions
- ArgumentNullException
If
addressOfRemoteServer
is null.
Properties
CommandInfoRepository
Gets the repository of objects containing information about commands.
protected CommandInfoRepository CommandInfoRepository { get; set; }
Property Value
Exceptions
- ArgumentNullException
If the value is set to null.
IsKeepAliveEnabled
Gets or sets a value indicating whether keep-alive is enabled for HTTP communication between this HttpCommandExecutor and the remote end WebDriver implementation.
public bool IsKeepAliveEnabled { get; set; }
Property Value
Proxy
Gets or sets an IWebProxy object to be used to proxy requests between this HttpCommandExecutor and the remote end WebDriver implementation.
public IWebProxy Proxy { get; set; }
Property Value
UserAgent
Gets or sets the user agent string used for HTTP communication batween this HttpCommandExecutor and the remote end WebDriver implementation
public string UserAgent { get; set; }
Property Value
Methods
Dispose()
Releases all resources used by the HttpCommandExecutor.
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 virtual 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 virtual Task<Response> ExecuteAsync(Command commandToExecute)
Parameters
commandToExecute
CommandThe command you wish to execute.
Returns
OnSendingRemoteHttpRequest(SendingRemoteHttpRequestEventArgs)
Raises the SendingRemoteHttpRequest event.
protected virtual void OnSendingRemoteHttpRequest(SendingRemoteHttpRequestEventArgs eventArgs)
Parameters
eventArgs
SendingRemoteHttpRequestEventArgsA SendingRemoteHttpRequestEventArgs that contains the event data.
TryAddCommand(string, CommandInfo)
Attempts to add a command to the repository of commands known to this executor.
public bool TryAddCommand(string commandName, CommandInfo info)
Parameters
commandName
stringThe name of the command to attempt to add.
info
CommandInfoThe CommandInfo describing the commnd to add.
Returns
Events
SendingRemoteHttpRequest
Occurs when the HttpCommandExecutor is sending an HTTP request to the remote end WebDriver implementation.
public event EventHandler<SendingRemoteHttpRequestEventArgs> SendingRemoteHttpRequest