function BrowserTestBase::xpath
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/BrowserTestBase.php \Drupal\Tests\BrowserTestBase::xpath()
- 10 core/tests/Drupal/Tests/BrowserTestBase.php \Drupal\Tests\BrowserTestBase::xpath()
- 8.9.x core/tests/Drupal/Tests/BrowserTestBase.php \Drupal\Tests\BrowserTestBase::xpath()
Performs an xpath search on the contents of the internal browser.
The search is relative to the root element (HTML tag normally) of the page.
Parameters
string $xpath: The xpath string to use in the search.
array $arguments: An array of arguments with keys in the form ':name' matching the placeholders in the query. The values may be either strings or numeric values.
Return value
\Behat\Mink\Element\NodeElement[] The list of elements matching the xpath expression.
11 calls to BrowserTestBase::xpath()
- BlockTest::testBlockTitle in core/
modules/ block/ tests/ src/ Functional/ BlockTest.php - Tests block title.
- DbLogTest::doUser in core/
modules/ dblog/ tests/ src/ Functional/ DbLogTest.php - Generates and then verifies some user events.
- DbLogTest::getLogsEntriesTable in core/
modules/ dblog/ tests/ src/ Functional/ DbLogTest.php - Find the Logs table in the DOM.
- DbLogViewsTest::getLogsEntriesTable in core/
modules/ dblog/ tests/ src/ Functional/ DbLogViewsTest.php - Find the Logs table in the DOM.
- FileFieldWidgetTest::testMultiValuedWidget in core/
modules/ file/ tests/ src/ FunctionalJavascript/ FileFieldWidgetTest.php - Tests upload and remove buttons for multiple multi-valued File fields.
File
-
core/
tests/ Drupal/ Tests/ BrowserTestBase.php, line 597
Class
- BrowserTestBase
- Provides a test case for functional Drupal tests.
Namespace
Drupal\TestsCode
protected function xpath($xpath, array $arguments = []) {
$xpath = $this->assertSession()
->buildXPathQuery($xpath, $arguments);
return $this->getSession()
->getPage()
->findAll('xpath', $xpath);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.