You are here

private function BrowserKitDriver::getFilteredCrawler in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php \Behat\Mink\Driver\BrowserKitDriver::getFilteredCrawler()

Returns a crawler filtered for the given XPath, requiring at least 1 result.

Parameters

string $xpath:

Return value

Crawler

Throws

DriverException when no matching elements are found

8 calls to BrowserKitDriver::getFilteredCrawler()
BrowserKitDriver::click in vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php
Clicks button or link located by it's XPath query.
BrowserKitDriver::getAttribute in vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php
Returns element's attribute by it's XPath query.
BrowserKitDriver::getFormField in vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php
Returns form field from XPath query.
BrowserKitDriver::getOuterHtml in vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php
Returns element's outer html by it's XPath query.
BrowserKitDriver::getValue in vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php
Returns element's value by it's XPath query.

... See full list

File

vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php, line 829

Class

BrowserKitDriver
Symfony2 BrowserKit driver.

Namespace

Behat\Mink\Driver

Code

private function getFilteredCrawler($xpath) {
  if (!count($crawler = $this
    ->getCrawler()
    ->filterXPath($xpath))) {
    throw new DriverException(sprintf('There is no element matching XPath "%s"', $xpath));
  }
  return $crawler;
}