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

Breadcrumb

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

function Execute::makeElement

Factory method for elements

Parameters

array $value:

Return value

\WebDriver\Element|\WebDriver\Shadow|null

1 call to Execute::makeElement()
Execute::unserializeResult in vendor/lullabot/php-webdriver/lib/WebDriver/Execute.php
Unserialize result (containing web elements and/or shadow roots)

File

vendor/lullabot/php-webdriver/lib/WebDriver/Execute.php, line 118

Class

Execute
WebDriver\Execute class

Namespace

WebDriver

Code

protected function makeElement($value) {
    if (array_key_exists(LegacyElement::LEGACY_ELEMENT_ID, $value)) {
        $identifier = $value[LegacyElement::LEGACY_ELEMENT_ID];
        return new LegacyElement($this->getIdentifierPath('/element/' . $identifier), $identifier);
    }
    if (array_key_exists(Element::WEB_ELEMENT_ID, $value)) {
        $identifier = $value[Element::WEB_ELEMENT_ID];
        return new Element($this->getIdentifierPath('/element/' . $identifier), $identifier);
    }
    if (array_key_exists(Shadow::SHADOW_ROOT_ID, $value)) {
        $identifier = $value[Shadow::SHADOW_ROOT_ID];
        return new Shadow($this->getIdentifierPath('/shadow/' . $identifier), $identifier);
    }
    return null;
}
RSS feed
Powered by Drupal