Skip to content

Commit 61e7c70

Browse files
[py] Correct usage of newSession around firstMatch and alwaysMatch
The code was using the backwards compatible mode when doing `newSession` and now puts the desired capabilities into `alwaysMatch`
1 parent 1ab7721 commit 61e7c70

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
@@ -177,9 +177,9 @@ def start_session(self, capabilities, browser_profile=None):
177177
if not isinstance(capabilities, dict):
178178
raise InvalidArgumentException("Capabilities must be a dictionary")
179179
w3c_caps = {"firstMatch": [], "alwaysMatch": {}}
180-
w3c_caps.update(capabilities)
181180
if browser_profile:
182-
w3c_caps["firstMatch"].append({"firefox_profile": browser_profile.encoded})
181+
capabilities["moz:firefoxOptions"]["profile"] = browser_profile.encoded
182+
w3c_caps["alwaysMatch"].update(capabilities)
183183
parameters = {"capabilities": w3c_caps,
184184
"desiredCapabilities": capabilities}
185185
response = self.execute(Command.NEW_SESSION, parameters)

0 commit comments

Comments
 (0)