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

Method GetElementsFromResponse

dotnet/src/webdriver/WebDriver.cs:537–553  ·  view source on GitHub ↗

Finds the elements that are in the response Response from the browser Collection of elements

(Response response)

Source from the content-addressed store, hash-verified

535 /// <param name="response">Response from the browser</param>
536 /// <returns>Collection of elements</returns>
537 internal ReadOnlyCollection<IWebElement> GetElementsFromResponse(Response response)
538 {
539 List<IWebElement> toReturn = new List<IWebElement>();
540 if (response.Value is object?[] elements)
541 {
542 foreach (object? elementObject in elements)
543 {
544 if (elementObject is Dictionary<string, object?> elementDictionary)
545 {
546 WebElement element = this.elementFactory.CreateElement(elementDictionary);
547 toReturn.Add(element);
548 }
549 }
550 }
551
552 return toReturn.AsReadOnly();
553 }
554
555 /// <summary>
556 /// Executes a command with this driver.

Callers 3

FindElementsMethod · 0.95
FindElementsMethod · 0.80
FindElementsMethod · 0.80

Calls 3

CreateElementMethod · 0.80
AddMethod · 0.45
AsReadOnlyMethod · 0.45

Tested by

no test coverage detected