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

Method GetCapabilitiesDictionary

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

641 /// once browser driver capability formats stabilize.</remarks>
642 /// <exception cref="ArgumentNullException">If <paramref name="capabilitiesToConvert"/> is <see langword="null"/>.</exception>
643 protected virtual Dictionary<string, object> GetCapabilitiesDictionary(ICapabilities capabilitiesToConvert)
644 {
645 ArgumentNullException.ThrowIfNull(capabilitiesToConvert);
646
647 Dictionary<string, object> capabilitiesDictionary = new Dictionary<string, object>();
648
649 foreach (KeyValuePair<string, object> entry in ((IHasCapabilitiesDictionary)capabilitiesToConvert).CapabilitiesDictionary)
650 {
651 if (CapabilityType.IsSpecCompliantCapabilityName(entry.Key))
652 {
653 capabilitiesDictionary.Add(entry.Key, entry.Value);
654 }
655 }
656
657 return capabilitiesDictionary;
658 }
659
660 /// <summary>
661 /// 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