src/Context/RawPageContext.php
public function findField($selector)
    {
        $selector = ltrim($selector, '#');
        $element = $this->getWorkingElement();

        foreach ($this->findLabels($selector) as $forAttribute => $label) {
            // We trying to find an ID with "-upload" suffix, because some
            // image inputs in Drupal are suffixed by it.
            foreach ([$forAttribute, "$forAttribute-upload"] as $elementID) {
                $field = $element->findById($elementID);

                if (null !== $field) {
                    return $field;
                }
            }
        }

        return $element->findField($selector);
    }
public function findField($selector)
    {
        $selector = ltrim($selector, '#');
        $element = $this->getWorkingElement();

        foreach ($this->findLabels($selector) as $forAttribute => $label) {
            // We trying to find an ID with "-upload" suffix, because some
            // image inputs in Drupal are suffixed by it.
            foreach ([$forAttribute, "$forAttribute-upload"] as $elementID) {
                $field = $element->findById($elementID);

                if (null !== $field) {
                    return $field;
                }
            }
        }

        return $element->findField($selector);
    }
public function findField ( $ selector ) { $ selector = ltrim ( $ selector , '#' ) ; $ element = $ this -> getWorkingElement ( ) ; foreach ( $ this -> findLabels ( $ selector ) as $ forAttribute => $ label ) { // We trying to find an ID with "-upload" suffix, because some // image inputs in Drupal are suffixed by it. foreach ( [ $ forAttribute , "$forAttribute-upload" ] as $ elementID ) { $ field = $ element -> findById ( $ elementID ) ; if ( null !== $ field ) { return $ field ; } } } return $ element -> findField ( $ selector ) ; }
@param string $selector

@return NodeElement|null
@param string $selector