Skip to content

Commit 9665dd7

Browse files
Pass in the executable that FirefoxBinary finds to the service if there isnt one passed in as a kwarg or capability
1 parent 0bf56ed commit 9665dd7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

py/selenium/webdriver/firefox/webdriver.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,13 @@ def __init__(self, firefox_profile=None, firefox_binary=None, timeout=30,
5353
if capabilities is None:
5454
capabilities = DesiredCapabilities.FIREFOX
5555

56+
if self.binary is None:
57+
self.binary = capabilities.get("binary") or FirefoxBinary()
58+
5659
# marionette
5760
if capabilities.get("marionette"):
58-
self.binary = capabilities.get("binary")
61+
if isinstance(self.binary, FirefoxBinary):
62+
self.binary = self.binary._get_firefox_start_cmd()
5963
self.service = Service(executable_path, firefox_binary=self.binary)
6064
self.service.start()
6165

@@ -68,9 +72,6 @@ def __init__(self, firefox_profile=None, firefox_binary=None, timeout=30,
6872
keep_alive=True)
6973
else:
7074
# Oh well... sometimes the old way is the best way.
71-
if self.binary is None:
72-
self.binary = FirefoxBinary()
73-
7475
if proxy is not None:
7576
proxy.add_to_capabilities(capabilities)
7677

0 commit comments

Comments
 (0)