MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / add_credential

Method add_credential

py/selenium/webdriver/remote/webdriver.py:1752–1766  ·  view source on GitHub ↗

Injects a credential into the authenticator. Example: ``` from selenium.webdriver.common.credential import Credential credential = Credential(id="user@example.com", password="aPassword") driver.add_credential(credential) ```

(self, credential: Credential)

Source from the content-addressed store, hash-verified

1750
1751 @_required_virtual_authenticator
1752 def add_credential(self, credential: Credential) -> None:
1753 """Injects a credential into the authenticator.
1754
1755 Example:
1756 ```
1757 from selenium.webdriver.common.credential import Credential
1758
1759 credential = Credential(id="user@example.com", password="aPassword")
1760 driver.add_credential(credential)
1761 ```
1762 """
1763 self.execute(
1764 Command.ADD_CREDENTIAL,
1765 {**credential.to_dict(), "authenticatorId": self._authenticator_id},
1766 )
1767
1768 @_required_virtual_authenticator
1769 def get_credentials(self) -> list[Credential]:

Calls 2

executeMethod · 0.95
to_dictMethod · 0.45