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

Breadcrumb

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

function Container::makeElement

Factory method for elements

Parameters

mixed $value:

Return value

\WebDriver\Element|null

2 calls to Container::makeElement()
Container::element in vendor/lullabot/php-webdriver/lib/WebDriver/Container.php
Find element: /session/:sessionId/element (POST) Find child element: /session/:sessionId/element/:id/element (POST) Search for element on page, starting from the document root.
Session::activeElement in vendor/lullabot/php-webdriver/lib/WebDriver/Session.php
Get active element (i.e., has focus): /session/:sessionId/element/active (POST)

File

vendor/lullabot/php-webdriver/lib/WebDriver/Container.php, line 198

Class

Container
Abstract WebDriver\Container class

Namespace

WebDriver

Code

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