OpenQA.Selenium.Chrome.ChromeDriverService.CreateDefaultService C# (CSharp) Method

CreateDefaultService() public static method

Creates a default instance of the ChromeDriverService.
public static CreateDefaultService ( ) : ChromeDriverService
return ChromeDriverService
        public static ChromeDriverService CreateDefaultService()
        {
            Assembly executingAssembly = Assembly.GetExecutingAssembly();
            string currentDirectory = Path.GetDirectoryName(executingAssembly.Location);

            // If we're shadow copying, fiddle with
            // the codebase instead
            if (AppDomain.CurrentDomain.ShadowCopyFiles)
            {
                Uri uri = new Uri(executingAssembly.CodeBase);
                currentDirectory = Path.GetDirectoryName(uri.LocalPath);
            }

            return CreateDefaultService(currentDirectory);
        }

Same methods

ChromeDriverService::CreateDefaultService ( string driverPath ) : ChromeDriverService

Usage Example

コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChromeDriver"/> class using the specified options.
 /// </summary>
 /// <param name="options">The <see cref="ChromeOptions"/> to be used with the Chrome driver.</param>
 public ChromeDriver(ChromeOptions options)
     : this(ChromeDriverService.CreateDefaultService(), options, RemoteWebDriver.DefaultCommandTimeout)
 {
 }
All Usage Examples Of OpenQA.Selenium.Chrome.ChromeDriverService::CreateDefaultService