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

Method AddCredential

dotnet/src/webdriver/WebDriver.cs:1122–1132  ·  view source on GitHub ↗

Add a credential to the Virtual Authenticator/ The credential to be stored in the Virtual Authenticator If is . If a Virtual Authenticator has not been added yet.

(Credential credential)

Source from the content-addressed store, hash-verified

1120 /// <exception cref="ArgumentNullException">If <paramref name="credential"/> is <see langword="null"/>.</exception>
1121 /// <exception cref="InvalidOperationException">If a Virtual Authenticator has not been added yet.</exception>
1122 public void AddCredential(Credential credential)
1123 {
1124 ArgumentNullException.ThrowIfNull(credential);
1125
1126 string authenticatorId = this.AuthenticatorId ?? throw new InvalidOperationException("Virtual Authenticator needs to be added before it can perform operations");
1127
1128 Dictionary<string, object?> parameters = new Dictionary<string, object?>(credential.ToDictionary());
1129 parameters.Add("authenticatorId", authenticatorId);
1130
1131 this.Execute(driverCommandToExecute: DriverCommand.AddCredential, parameters);
1132 }
1133
1134 /// <summary>
1135 /// Retrieves all the credentials stored in the Virtual Authenticator

Calls 4

ExecuteMethod · 0.95
ThrowIfNullMethod · 0.80
ToDictionaryMethod · 0.45
AddMethod · 0.45