findElements method Null safety

  1. @override
List<WebElement> findElements(
  1. By by
)
override

Search for multiple elements within the entire current page.

Implementation

@override
List<WebElement> findElements(By by) {
  final ids = _client.send(
      _handler.elementFinder.buildFindElementsRequest(by),
      _handler.elementFinder.parseFindElementsResponse);

  final elements = <WebElement>[];
  var i = 0;
  for (final id in ids) {
    elements.add(WebElement(this, _client, _handler, id, this, by, i++));
  }

  return elements;
}