From 3b42a898e625a3b78ba2d53a22687b576a093e48 Mon Sep 17 00:00:00 2001 From: Nikolay Borisenko <22616990+nvborisenko@users.noreply.github.com> Date: Wed, 15 May 2024 12:21:10 +0300 Subject: [PATCH] [dotnet] Align binary location property for FirefoxOptions with other options (#13901) --- dotnet/src/webdriver/Firefox/FirefoxOptions.cs | 15 ++++++++------- dotnet/test/common/Environment/DriverFactory.cs | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dotnet/src/webdriver/Firefox/FirefoxOptions.cs b/dotnet/src/webdriver/Firefox/FirefoxOptions.cs index bbdc5a01bd20d..a5c8c0a5d494e 100644 --- a/dotnet/src/webdriver/Firefox/FirefoxOptions.cs +++ b/dotnet/src/webdriver/Firefox/FirefoxOptions.cs @@ -61,7 +61,7 @@ public class FirefoxOptions : DriverOptions private const string FirefoxEnableDevToolsProtocolCapability = "moz:debuggerAddress"; private bool enableDevToolsProtocol; - private string browserBinaryLocation; + private string binaryLocation; private FirefoxDriverLogLevel logLevel = FirefoxDriverLogLevel.Default; private FirefoxProfile profile; private List firefoxArguments = new List(); @@ -104,17 +104,18 @@ public FirefoxProfile Profile /// public override string BinaryLocation { - get { return this.browserBinaryLocation; } - set { this.browserBinaryLocation = value; } + get { return this.binaryLocation; } + set { this.binaryLocation = value; } } /// /// Gets or sets the path and file name of the Firefox browser executable. /// + [Obsolete("Use BinaryLocation property instead of BrowserExecutableLocation. This one will be removed soon.")] public string BrowserExecutableLocation { - get { return this.browserBinaryLocation; } - set { this.browserBinaryLocation = value; } + get { return this.binaryLocation; } + set { this.binaryLocation = value; } } /// @@ -302,9 +303,9 @@ private Dictionary GenerateFirefoxOptionsDictionary() firefoxOptions[FirefoxProfileCapability] = this.profile.ToBase64String(); } - if (!string.IsNullOrEmpty(this.browserBinaryLocation)) + if (!string.IsNullOrEmpty(this.binaryLocation)) { - firefoxOptions[FirefoxBinaryCapability] = this.browserBinaryLocation; + firefoxOptions[FirefoxBinaryCapability] = this.binaryLocation; } if (this.logLevel != FirefoxDriverLogLevel.Default) diff --git a/dotnet/test/common/Environment/DriverFactory.cs b/dotnet/test/common/Environment/DriverFactory.cs index a363f077a5c5a..448dfc61d1a98 100644 --- a/dotnet/test/common/Environment/DriverFactory.cs +++ b/dotnet/test/common/Environment/DriverFactory.cs @@ -117,7 +117,7 @@ public IWebDriver CreateDriverWithOptions(Type driverType, DriverOptions driverO service = CreateService(); if (!string.IsNullOrEmpty(this.browserBinaryLocation)) { - ((FirefoxOptions)options).BrowserExecutableLocation = this.browserBinaryLocation; + ((FirefoxOptions)options).BinaryLocation = this.browserBinaryLocation; } if (enableLogging) {