Skip to content

Commit d453c86

Browse files
committed
Updating .NET FirefoxOptions to not force specifying binary location
In the Marionette/Geckodriver case, the service executable can locate the Firefox executable on its own when looking in default installation locations. There is no need for the language bindings to go spelunking through the registry in that case any longer because the bindings do not have to directly launch the Firefox executable.
1 parent 4cf028a commit d453c86

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

dotnet/src/webdriver/Firefox/FirefoxOptions.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <copyright file="FirefoxOptions.cs" company="WebDriver Committers">
1+
// <copyright file="FirefoxOptions.cs" company="WebDriver Committers">
22
// Licensed to the Software Freedom Conservancy (SFC) under one
33
// or more contributor license agreements. See the NOTICE file
44
// distributed with this work for additional information
@@ -355,12 +355,15 @@ private Dictionary<string, object> GenerateFirefoxOptionsDictionary()
355355
}
356356
else
357357
{
358-
using (FirefoxBinary executablePathBinary = new FirefoxBinary())
358+
if (!this.isMarionette)
359359
{
360-
string executablePath = executablePathBinary.BinaryExecutable.ExecutablePath;
361-
if (!string.IsNullOrEmpty(executablePath))
360+
using (FirefoxBinary executablePathBinary = new FirefoxBinary())
362361
{
363-
firefoxOptions[FirefoxBinaryCapability] = executablePath;
362+
string executablePath = executablePathBinary.BinaryExecutable.ExecutablePath;
363+
if (!string.IsNullOrEmpty(executablePath))
364+
{
365+
firefoxOptions[FirefoxBinaryCapability] = executablePath;
366+
}
364367
}
365368
}
366369
}

0 commit comments

Comments
 (0)