Skip to content

Commit 9e68025

Browse files
committed
Update desired and required capabilities rather than replacing them in the Python client
1 parent 05e5799 commit 9e68025

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

py/selenium/webdriver/remote/webdriver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ def start_session(self, desired_capabilities, browser_profile=None):
166166
- javascript_enabled - Whether the new session should support JavaScript.
167167
- browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object. Only used if Firefox is requested.
168168
"""
169-
capabilities = {'desiredCapabilities': {}}
169+
capabilities = {'desiredCapabilities': {}, 'requiredCapabilities': {}}
170170
for k, v in desired_capabilities.items():
171171
if k not in ('desiredCapabilities', 'requiredCapabilities'):
172172
capabilities['desiredCapabilities'][k] = v
173173
else:
174-
capabilities[k] = v
174+
capabilities[k].update(v)
175175
if browser_profile:
176176
capabilities['desiredCapabilities']['firefox_profile'] = browser_profile.encoded
177177
response = self.execute(Command.NEW_SESSION, capabilities)

0 commit comments

Comments
 (0)