Skip to content

Commit 00f76a5

Browse files
committed
refactored continue_with_auth to proceed with ContinueWithNoAuthCredentials per BiDi spec
1 parent 515ab58 commit 00f76a5

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

py/selenium/webdriver/common/bidi/network.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,20 +241,29 @@ def _callback(request):
241241

242242
return self.add_request_handler(event, _callback)
243243

244-
def _continue_with_auth(self, request, username, password):
244+
def _continue_with_auth(self, request, username=None, password=None):
245245
"""Continue with authentication.
246246
247247
Parameters:
248248
----------
249249
request (Request): The request to continue with.
250250
username (str): The username to authenticate with.
251251
password (str): The password to authenticate with.
252+
253+
Notes:
254+
-----
255+
If username or password is None, it attempts auth with no credentials
252256
"""
253257

254258
params = {}
255259
params["request"] = request.request_id
256-
params["action"] = "provideCredentials"
257-
params["credentials"] = {"type": "password", "username": username, "password": password}
260+
261+
if not username or not password:
262+
params["action"] = "default"
263+
264+
else:
265+
params["action"] = "provideCredentials"
266+
params["credentials"] = {"type": "password", "username": username, "password": password}
258267

259268
self.conn.execute(self.command_builder("network.continueWithAuth", params))
260269

0 commit comments

Comments
 (0)