Skip to content

Commit 227674b

Browse files
bayandinandreastt
authored andcommitted
Do not pass sessionId if it is not exists
Signed-off-by: Andreas Tolfsen <[email protected]>
1 parent d834b32 commit 227674b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

py/selenium/webdriver/remote/webdriver.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,11 @@ def execute(self, driver_command, params=None):
161161
:Returns:
162162
The command's JSON response loaded into a dictionary object.
163163
"""
164-
if not params:
165-
params = {'sessionId': self.session_id}
166-
elif 'sessionId' not in params:
167-
params['sessionId'] = self.session_id
164+
if self.session_id is not None:
165+
if not params:
166+
params = {'sessionId': self.session_id}
167+
elif 'sessionId' not in params:
168+
params['sessionId'] = self.session_id
168169

169170
params = self._wrap_value(params)
170171
response = self.command_executor.execute(driver_command, params)

0 commit comments

Comments
 (0)