Table of Contents

Class DriverService

Namespace
OpenQA.Selenium
Assembly
WebDriver.dll

Exposes the service provided by a native WebDriver server executable.

public abstract class DriverService : ICommandServer, IDisposable
Inheritance
DriverService
Implements
Derived
Inherited Members

Constructors

DriverService(string, int, string, Uri)

Initializes a new instance of the DriverService class.

protected DriverService(string servicePath, int port, string driverServiceExecutableName, Uri driverServiceDownloadUrl)

Parameters

servicePath string

The full path to the directory containing the executable providing the service to drive the browser.

port int

The port on which the driver executable should listen.

driverServiceExecutableName string

The file name of the driver service executable.

driverServiceDownloadUrl Uri

A URL at which the driver service executable may be downloaded.

Exceptions

ArgumentException

If the path specified is null or an empty string.

DriverServiceNotFoundException

If the specified driver service executable does not exist in the specified directory.

Properties

CommandLineArguments

Gets the command-line arguments for the driver service.

protected virtual string CommandLineArguments { get; }

Property Value

string

DriverServiceExecutableName

Gets the executable file name of the driver service.

protected string DriverServiceExecutableName { get; }

Property Value

string

HideCommandPromptWindow

Gets or sets a value indicating whether the command prompt window of the service should be hidden.

public bool HideCommandPromptWindow { get; set; }

Property Value

bool

IgnoreMissingStatusEndPoint

protected virtual bool IgnoreMissingStatusEndPoint { get; }

Property Value

bool

InitialConnectionTimeout

protected virtual TimeSpan InitialConnectionTimeout { get; }

Property Value

TimeSpan

IsRunning

Gets a value indicating whether the service is running.

public bool IsRunning { get; }

Property Value

bool

Port

Gets or sets the port of the service.

public int Port { get; set; }

Property Value

int

ProcessId

Gets the process ID of the running driver service executable. Returns 0 if the process is not running.

public int ProcessId { get; }

Property Value

int

ServiceUrl

Gets the Uri of the service.

public Uri ServiceUrl { get; }

Property Value

Uri

SuppressInitialDiagnosticInformation

Gets or sets a value indicating whether the initial diagnostic information is suppressed when starting the driver server executable. Defaults to false, meaning diagnostic information should be shown by the driver server executable.

public bool SuppressInitialDiagnosticInformation { get; set; }

Property Value

bool

Methods

Dispose()

Releases all resources associated with this DriverService.

public void Dispose()

Dispose(bool)

Releases all resources associated with this DriverService.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true if the Dispose method was explicitly called; otherwise, false.

FindDriverServiceExecutable(string, Uri)

Finds the specified driver service executable.

protected static string FindDriverServiceExecutable(string executableName, Uri downloadUrl)

Parameters

executableName string

The file name of the executable to find.

downloadUrl Uri

A URL at which the driver service executable may be downloaded.

Returns

string

The directory containing the driver service executable.

Exceptions

DriverServiceNotFoundException

If the specified driver service executable does not exist in the current directory or in a directory on the system path.

Start()

Starts the DriverService.

public void Start()