diff --git a/dotnet/src/webdriver/Chrome/ChromeDriverService.cs b/dotnet/src/webdriver/Chrome/ChromeDriverService.cs index 1210c640ddf4f..d7c560951e2fe 100644 --- a/dotnet/src/webdriver/Chrome/ChromeDriverService.cs +++ b/dotnet/src/webdriver/Chrome/ChromeDriverService.cs @@ -33,7 +33,6 @@ public sealed class ChromeDriverService : ChromiumDriverService private static readonly Uri ChromeDriverDownloadUrl = new Uri("http://chromedriver.storage.googleapis.com/index.html"); - /// /// Initializes a new instance of the class. /// diff --git a/dotnet/src/webdriver/Edge/EdgeDriverService.cs b/dotnet/src/webdriver/Edge/EdgeDriverService.cs index 8621ecb17d70d..959e379a7eb00 100644 --- a/dotnet/src/webdriver/Edge/EdgeDriverService.cs +++ b/dotnet/src/webdriver/Edge/EdgeDriverService.cs @@ -30,12 +30,12 @@ namespace OpenQA.Selenium.Edge public sealed class EdgeDriverService : ChromiumDriverService { private const string MicrosoftWebDriverServiceFileName = "MicrosoftWebDriver.exe"; + private const string MSEdgeDriverServiceFileName = "MSEdgeDriver.exe"; private static readonly Uri MicrosoftWebDriverDownloadUrl = new Uri("https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/"); private string host; private string package; private bool useVerboseLogging; private bool? useSpecCompliantProtocol; - private const string MSEdgeDriverServiceFileName = "MSEdgeDriver.exe"; private bool isLegacy; /// @@ -209,7 +209,9 @@ protected override string CommandLineArguments get { if (!this.isLegacy) + { return base.CommandLineArguments; + } StringBuilder argsBuilder = new StringBuilder(base.CommandLineArguments); if (!string.IsNullOrEmpty(this.host)) @@ -255,9 +257,13 @@ protected override string CommandLineArguments /// A EdgeDriverService that implements default settings. public static EdgeDriverService CreateDefaultService(bool isLegacy = true) { - string serviceDirectory = DriverService.FindDriverServiceExecutable( - isLegacy ? MicrosoftWebDriverServiceFileName : ChromiumDriverServiceFileName(MSEdgeDriverServiceFileName), - MicrosoftWebDriverDownloadUrl); + string serviceFileName = ChromiumDriverServiceFileName(MSEdgeDriverServiceFileName); + if (isLegacy) + { + serviceFileName = MicrosoftWebDriverServiceFileName; + } + + string serviceDirectory = DriverService.FindDriverServiceExecutable(serviceFileName, MicrosoftWebDriverDownloadUrl); EdgeDriverService service = CreateDefaultService(serviceDirectory, isLegacy); return service; } @@ -270,10 +276,13 @@ public static EdgeDriverService CreateDefaultService(bool isLegacy = true) /// A EdgeDriverService using a random port. public static EdgeDriverService CreateDefaultService(string driverPath, bool isLegacy = true) { - return CreateDefaultService( - driverPath, - isLegacy ? MicrosoftWebDriverServiceFileName : ChromiumDriverServiceFileName(MSEdgeDriverServiceFileName), - isLegacy); + string serviceFileName = ChromiumDriverServiceFileName(MSEdgeDriverServiceFileName); + if (isLegacy) + { + serviceFileName = MicrosoftWebDriverServiceFileName; + } + + return CreateDefaultService(driverPath, serviceFileName, isLegacy); } ///