Table of Contents

Class DriverServiceCommandExecutor

Namespace
OpenQA.Selenium.Remote
Assembly
WebDriver.dll

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 DriverService

The DriverService that drives the browser.

commandExecutor HttpCommandExecutor

The HttpCommandExecutor object used to execute commands, communicating with the service via HTTP.

Exceptions

ArgumentNullException

If service or commandExecutor are null.

DriverServiceCommandExecutor(DriverService, TimeSpan)

Initializes a new instance of the DriverServiceCommandExecutor class.

public DriverServiceCommandExecutor(DriverService driverService, TimeSpan commandTimeout)

Parameters

driverService DriverService

The DriverService that drives the browser.

commandTimeout TimeSpan

The 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 DriverService

The DriverService that drives the browser.

commandTimeout TimeSpan

The maximum amount of time to wait for each command.

enableKeepAlive bool

true 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

HttpCommandExecutor

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

disposing bool

true to release managed and resources; false to only release unmanaged resources.

Execute(Command)

Executes a command

public Response Execute(Command commandToExecute)

Parameters

commandToExecute Command

The 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 Command

The command you wish to execute

Returns

Task<Response>

A task object representing the asynchronous operation

TryAddCommand(string, CommandInfo)

Gets the CommandInfoRepository object associated with this executor.

public bool TryAddCommand(string commandName, CommandInfo info)

Parameters

commandName string
info CommandInfo

Returns

bool