Skip to content

Commit 9e07957

Browse files
committed
authenticateUsing implicitly clicks ok on the dialog
1 parent 1b35bc6 commit 9e07957

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

java/client/src/org/openqa/selenium/remote/RemoteWebDriver.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,7 @@ public void sendKeys(String keysToSend) {
936936

937937
/**
938938
* Authenticate an HTTP Basic Auth dialog.
939+
* Implicitly 'clicks ok'
939940
*
940941
* Usage: driver.switchTo().alert().authenticateUsing(new UsernamePasswordCredentials("cheese",
941942
* "secretGouda"));
@@ -946,6 +947,7 @@ public void authenticateUsing(Credentials credentials) {
946947
execute(DriverCommand.SET_ALERT_CREDENTIALS, ImmutableMap
947948
.of("username", credentials.getUserPrincipal().getName(), "password",
948949
credentials.getPassword()));
950+
this.accept();
949951
}
950952
}
951953

py/selenium/webdriver/common/alert.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ def send_keys(self, keysToSend):
9292

9393
def authenticate(self, username, password):
9494
"""
95-
Send the username / password to an Authenticated dialog (like with Basic HTTP Auth)
95+
Send the username / password to an Authenticated dialog (like with Basic HTTP Auth).
96+
Implicitly 'clicks ok'
9697
9798
Usage::
9899
driver.switch_to.alert.authenticate('cheese', 'secretGouda')
@@ -102,3 +103,4 @@ def authenticate(self, username, password):
102103
-password: string to be set in the password section of the dialog
103104
"""
104105
self.driver.execute(Command.SET_ALERT_CREDENTIALS, {'username':username, 'password':password})
106+
self.accept()

0 commit comments

Comments
 (0)