/** * Find all WebDriverElements within the current page using the given * mechanism. * * @param WebDriverBy $by * @return array A list of all WebDriverElements, or an empty array if * nothing matches * @see WebDriverBy */ public function findElements(WebDriverBy $by) { $params = array('using' => $by->getMechanism(), 'value' => $by->getValue()); $raw_elements = $this->executor->execute('findElements', $params); $elements = array(); foreach ($raw_elements as $raw_element) { $elements[] = $this->newElement($raw_element['ELEMENT']); } return $elements; }