Skip to content

Commit

Permalink
[dotnet] Align binary location property for FirefoxOptions with other…
Browse files Browse the repository at this point in the history
… options (#13901)
  • Loading branch information
nvborisenko authored May 15, 2024
1 parent cf5234d commit 3b42a89
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions dotnet/src/webdriver/Firefox/FirefoxOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> firefoxArguments = new List<string>();
Expand Down Expand Up @@ -104,17 +104,18 @@ public FirefoxProfile Profile
/// </summary>
public override string BinaryLocation
{
get { return this.browserBinaryLocation; }
set { this.browserBinaryLocation = value; }
get { return this.binaryLocation; }
set { this.binaryLocation = value; }
}

/// <summary>
/// Gets or sets the path and file name of the Firefox browser executable.
/// </summary>
[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; }
}

/// <summary>
Expand Down Expand Up @@ -302,9 +303,9 @@ private Dictionary<string, object> 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)
Expand Down
2 changes: 1 addition & 1 deletion dotnet/test/common/Environment/DriverFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public IWebDriver CreateDriverWithOptions(Type driverType, DriverOptions driverO
service = CreateService<FirefoxDriverService>();
if (!string.IsNullOrEmpty(this.browserBinaryLocation))
{
((FirefoxOptions)options).BrowserExecutableLocation = this.browserBinaryLocation;
((FirefoxOptions)options).BinaryLocation = this.browserBinaryLocation;
}
if (enableLogging)
{
Expand Down

0 comments on commit 3b42a89

Please sign in to comment.