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

Breadcrumb

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

function Element::shadow

Get element shadow root: /session/:sessionId/element/:elementId/shadow

shadow root method chaining, e.g.,

  • $element->method()

Return value

\WebDriver\Shadow|null

File

vendor/lullabot/php-webdriver/lib/WebDriver/Element.php, line 127

Class

Element
WebDriver\Element class

Namespace

WebDriver

Code

public function shadow() {
    $result = $this->curl('POST', '/shadow');
    $value = $result['value'];
    if (array_key_exists(Shadow::SHADOW_ROOT_ID, (array) $value)) {
        $shadowRootReference = $value[Shadow::SHADOW_ROOT_ID];
        return new Shadow(preg_replace('/' . preg_quote('element/' . $this->id, '/') . '$/', '/', $this->url), $shadowRootReference);
    }
    return null;
}

API Navigation

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