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

Method GetCapabilitiesDictionary

dotnet/src/webdriver/WebDriver.cs:701–716  ·  view source on GitHub ↗

Gets the capabilities as a dictionary. The dictionary to return. A Dictionary consisting of the capabilities requested. This method is only transitional. Do not rely on it. It will be removed once browser driver capability formats stabilize. If <paramref na

(ICapabilities capabilitiesToConvert)

Source from the content-addressed store, hash-verified

699 /// once browser driver capability formats stabilize.</remarks>
700 /// <exception cref="ArgumentNullException">If <paramref name="capabilitiesToConvert"/> is <see langword="null"/>.</exception>
701 protected virtual Dictionary<string, object> GetCapabilitiesDictionary(ICapabilities capabilitiesToConvert)
702 {
703 ArgumentNullException.ThrowIfNull(capabilitiesToConvert);
704
705 Dictionary<string, object> capabilitiesDictionary = new Dictionary<string, object>();
706
707 foreach (KeyValuePair<string, object> entry in ((IHasCapabilitiesDictionary)capabilitiesToConvert).CapabilitiesDictionary)
708 {
709 if (CapabilityType.IsSpecCompliantCapabilityName(entry.Key))
710 {
711 capabilitiesDictionary.Add(entry.Key, entry.Value);
712 }
713 }
714
715 return capabilitiesDictionary;
716 }
717
718 /// <summary>
719 /// Registers a command to be executed with this driver instance as an internally known driver command.

Callers 1

StartSessionMethod · 0.95

Calls 3

ThrowIfNullMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected