Skip to content

Commit e70ce52

Browse files
committed
Avoid overriding capabilities with the defaults when using Firefox options
1 parent a5d890f commit e70ce52

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

py/selenium/webdriver/firefox/options.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# under the License.
1717

1818
from selenium.common.exceptions import WebDriverException
19-
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
2019
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
2120

2221

@@ -87,14 +86,11 @@ def to_capabilities(self):
8786
8887
returns a dictionary with everything
8988
"""
90-
firefox = DesiredCapabilities.FIREFOX.copy()
91-
firefox_options = self._firefox_options
89+
required = {}
9290
if self.binary_location:
93-
firefox_options["binary"] = self.binary_location
91+
required["binary"] = self.binary_location
9492
if self._profile:
95-
firefox_options["profile"] = self._profile.encoded
96-
firefox_options["args"] = self.arguments
97-
98-
firefox["requiredCapabilities"] = firefox_options
99-
100-
return firefox
93+
required["profile"] = self._profile.encoded
94+
required["args"] = self.arguments
95+
capabilities = {"requiredCapabilities": required}
96+
return capabilities

0 commit comments

Comments
 (0)