OpenQA.Selenium.DriverService.DriverService C# (CSharp) Метод

DriverService() защищенный Метод

Initializes a new instance of the DriverService class.
/// If the path specified is or an empty string. /// /// If the specified driver service executable does not exist in the specified directory. ///
protected DriverService ( string servicePath, int port, string driverServiceExecutableName, Uri driverServiceDownloadUrl ) : System
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 System.Uri A URL at which the driver service executable may be downloaded.
Результат System
        protected DriverService(string servicePath, int port, string driverServiceExecutableName, Uri driverServiceDownloadUrl)
        {
            if (string.IsNullOrEmpty(servicePath))
            {
                throw new ArgumentException("Path to locate driver executable cannot be null or empty.", "servicePath");
            }

            string executablePath = Path.Combine(servicePath, driverServiceExecutableName);
            if (!File.Exists(executablePath))
            {
                throw new DriverServiceNotFoundException(string.Format(CultureInfo.InvariantCulture, "The file {0} does not exist. The driver can be downloaded at {1}", executablePath, driverServiceDownloadUrl));
            }

            this.driverServicePath = servicePath;
            this.driverServiceExecutableName = driverServiceExecutableName;
            this.driverServicePort = port;
        }