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

Method ContainsMatchCapability

dotnet/src/webdriver/WebDriver.cs:668–691  ·  view source on GitHub ↗
(Dictionary<string, object?> capabilitiesDictionary, string capabilityName)

Source from the content-addressed store, hash-verified

666 }
667
668 private static bool ContainsMatchCapability(Dictionary<string, object?> capabilitiesDictionary, string capabilityName)
669 {
670 if (capabilitiesDictionary.TryGetValue("alwaysMatch", out object? alwaysMatch)
671 && alwaysMatch is IDictionary<string, object> alwaysMatchCapabilities
672 && alwaysMatchCapabilities.ContainsKey(capabilityName))
673 {
674 return true;
675 }
676
677 if (capabilitiesDictionary.TryGetValue("firstMatch", out object? firstMatch)
678 && firstMatch is IEnumerable<object> firstMatchCandidates)
679 {
680 foreach (object candidate in firstMatchCandidates)
681 {
682 if (candidate is IDictionary<string, object> firstMatchCapabilities
683 && firstMatchCapabilities.ContainsKey(capabilityName))
684 {
685 return true;
686 }
687 }
688 }
689
690 return false;
691 }
692
693 /// <summary>
694 /// Gets the capabilities as a dictionary.

Callers

nothing calls this directly

Calls 1

TryGetValueMethod · 0.45

Tested by

no test coverage detected