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

Method AddCredential

dotnet/src/webdriver/WebDriver.cs:1064–1074  ·  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

1062 /// <exception cref="ArgumentNullException">If <paramref name="credential"/> is <see langword="null"/>.</exception>
1063 /// <exception cref="InvalidOperationException">If a Virtual Authenticator has not been added yet.</exception>
1064 public void AddCredential(Credential credential)
1065 {
1066 ArgumentNullException.ThrowIfNull(credential);
1067
1068 string authenticatorId = this.AuthenticatorId ?? throw new InvalidOperationException("Virtual Authenticator needs to be added before it can perform operations");
1069
1070 Dictionary<string, object?> parameters = new Dictionary<string, object?>(credential.ToDictionary());
1071 parameters.Add("authenticatorId", authenticatorId);
1072
1073 this.Execute(driverCommandToExecute: DriverCommand.AddCredential, parameters);
1074 }
1075
1076 /// <summary>
1077 /// Retrieves all the credentials stored in the Virtual Authenticator

Calls 4

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