You are here

public function Element::findAll in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink/src/Element/Element.php \Behat\Mink\Element\Element::findAll()

Finds all elements with specified selector inside the current element.

Valid selector engines are named, xpath, css, named_partial and named_exact.

'named' is a pseudo selector engine which prefers an exact match but will return a partial match if no exact match is found. 'xpath' is a pseudo selector engine supported by SelectorsHandler.

More selector engines can be registered in the SelectorsHandler.

Parameters

string $selector selector engine name:

string|array $locator selector locator:

Return value

NodeElement[]

Overrides ElementInterface::findAll

See also

NamedSelector for the locators supported by the named selectors

1 call to Element::findAll()
Element::find in vendor/behat/mink/src/Element/Element.php
Finds first element with specified selector inside the current element.

File

vendor/behat/mink/src/Element/Element.php, line 154

Class

Element
Base element.

Namespace

Behat\Mink\Element

Code

public function findAll($selector, $locator) {
  if ('named' === $selector) {
    $items = $this
      ->findAll('named_exact', $locator);
    if (empty($items)) {
      $items = $this
        ->findAll('named_partial', $locator);
    }
    return $items;
  }
  $xpath = $this->selectorsHandler
    ->selectorToXpath($selector, $locator);
  $xpath = $this->xpathManipulator
    ->prepend($xpath, $this
    ->getXpath());
  return $this
    ->getDriver()
    ->find($xpath);
}