(WebDriver parentDriver, Dictionary<string, object?> shadowRootDictionary, [NotNullWhen(true)] out ShadowRoot? shadowRoot)
| 59 | string IWebDriverObjectReference.ObjectReferenceId => this.shadowRootId; |
| 60 | |
| 61 | internal static bool TryCreate(WebDriver parentDriver, Dictionary<string, object?> shadowRootDictionary, [NotNullWhen(true)] out ShadowRoot? shadowRoot) |
| 62 | { |
| 63 | if (shadowRootDictionary is null) |
| 64 | { |
| 65 | throw new ArgumentNullException(nameof(shadowRootDictionary), "The dictionary containing the shadow root reference cannot be null"); |
| 66 | } |
| 67 | |
| 68 | if (shadowRootDictionary.TryGetValue(ShadowRootReferencePropertyName, out object? shadowRootValue)) |
| 69 | { |
| 70 | shadowRoot = new ShadowRoot(parentDriver, shadowRootValue?.ToString()!); |
| 71 | return true; |
| 72 | } |
| 73 | |
| 74 | shadowRoot = null; |
| 75 | return false; |
| 76 | } |
| 77 | |
| 78 | /// <summary> |
| 79 | /// Finds the first <see cref="IWebElement"/> using the given method. |
no test coverage detected