Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Selenium2Driver.php

function Selenium2Driver::executeJsOnXpath

Executes JS on a given element - pass in a js script string and {{ELEMENT}} will be replaced with a reference to the result of the $xpath query

@example $this->executeJsOnXpath($xpath, 'return {{ELEMENT}}.childNodes.length');

Parameters

string $xpath the xpath to search with:

string $script the script to execute:

bool $sync whether to run the script synchronously (default is TRUE):

Return value

mixed

Throws

DriverException

3 calls to Selenium2Driver::executeJsOnXpath()
Selenium2Driver::getAttribute in vendor/lullabot/mink-selenium2-driver/src/Selenium2Driver.php
Returns element's attribute by its XPath query.
Selenium2Driver::getHtml in vendor/lullabot/mink-selenium2-driver/src/Selenium2Driver.php
Returns element's inner html by its XPath query.
Selenium2Driver::getOuterHtml in vendor/lullabot/mink-selenium2-driver/src/Selenium2Driver.php
Returns element's outer html by its XPath query.

File

vendor/lullabot/mink-selenium2-driver/src/Selenium2Driver.php, line 313

Class

Selenium2Driver
Selenium2 driver.

Namespace

Behat\Mink\Driver

Code

protected function executeJsOnXpath(string $xpath, string $script, bool $sync = true) {
    return $this->executeJsOnElement($this->findElement($xpath), $script, $sync);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal