@param WebDriverElement $element

@return RemoteTouchScreen The instance.
338605
public function longPress(WebDriverElement $element)
    {
        $this->executor->execute(
            DriverCommand::TOUCH_LONG_PRESS,
            ['element' => $element->getID()]
        );

        return $this;
    }
437721
public function addElement(Element $element)
    {
        if (!in_array($element, $this->elements, true)) {
            array_push($this->elements, $element);
        }
        return $this;
    }
1267499
public function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
    {
        $url = $this->escapeUrl($this->getAuthoriseUrl());
        $disabled = false;
        //disable for ssl missing
        if (! $this->_isSecureUrl()) {
            $disabled = true;
        }

        $adminUser = $this->auth->getUser();
        $refreshToken = $adminUser->getRefreshToken();

        $title = ($refreshToken) ? __('Disconnect') : __('Connect');

        $url = ($refreshToken) ? $this->escapeUrl($this->getUrl(
            'dotdigitalgroup_email/studio/disconnect'
        )) : $url;

        return $this->getLayout()->createBlock(
            \Magento\Backend\Block\Widget\Button::class
        )
            ->setType('button')
            ->setLabel($title)
            ->setDisabled($disabled)
            ->setOnClick("window.location.href='" . $url . "'")
            ->toHtml();
    }
1373340
public function setElement($element = null)
    {
        $this->element = null;

        if (!$element = $this->internalResolveElement($element)) {
            $this->element = $this->elementId = null;
        } else {
            /** @var Element $element */
            $this->elementId = $element->id;
            $this->element = $element;
        }

        return $this;
    }
393484
private function loadCustomElementAssets(Element $element)
    {
        if($this->getGetCustomElementDefinition()) {
            $this->assets[$element->getTypeIdentifier()] = $element;
        }

        $xmls = array();
        if($element instanceof PortableCustomInteraction || $element instanceof PortableInfoControl){
            //some portable elements contains htmlentitied markup in their properties...
            $xmls = $this->getXmlProperties($element->getProperties());
        }

        //parse and extract assets from markup using XPATH
        if ($element instanceof CustomInteraction || $element instanceof InfoControl) {
            // http://php.net/manual/fr/simplexmlelement.xpath.php#116622
            $sanitizedMarkup = str_replace('xmlns=', 'ns=', $element->getMarkup());

            $xmls[] = new SimpleXMLElement($sanitizedMarkup);

            $this->loadCustomElementPropertiesAssets($element->getProperties());

            /** @var SimpleXMLElement $xml */
            foreach ($xmls as $xml) {
                foreach ($xml->xpath('//img') as $img) {
                    $this->addAsset('img', (string)$img['src']);
                }
                foreach ($xml->xpath('//video') as $video) {
                    $this->addAsset('video', (string)$video['src']);
                }
                foreach ($xml->xpath('//audio') as $audio) {
                    $this->addAsset('audio', (string)$audio['src']);
                }
            }
        }
    }
1025713
private function getFormNode(\DOMElement $element)
    {
        if ($element->hasAttribute('form')) {
            $formId = $element->getAttribute('form');
            $formNode = $element->ownerDocument->getElementById($formId);

            if (null === $formNode || 'form' !== $formNode->nodeName) {
                throw new DriverException(sprintf('The selected node has an invalid form attribute (%s).', $formId));
            }

            return $formNode;
        }

        $formNode = $element;

        do {
            // use the ancestor form element
            if (null === $formNode = $formNode->parentNode) {
                throw new DriverException('The selected node does not have a form ancestor.');
            }
        } while ('form' !== $formNode->nodeName);

        return $formNode;
    }
1057196
public static File takeScreenShot(WebElement iframe, WebElement element) {
    return screenshots.takeScreenshot(driver(), iframe, element);
  }
747797
public function from($element = null)
    {
        if (!empty($element) && $element instanceof Image) {
            foreach (get_object_vars($element) as $key => $value) {
                $this->$key = $value;
            }

            return $this;
        }
    }
1209993
public function dragAndDrop(WebDriverElement $source, WebDriverElement $target)
    {
        $this->action->addAction(
            new WebDriverClickAndHoldAction($this->mouse, $source)
        );
        $this->action->addAction(
            new WebDriverMouseMoveAction($this->mouse, $target)
        );
        $this->action->addAction(
            new WebDriverButtonReleaseAction($this->mouse, $target)
        );

        return $this;
    }
1003009
protected function select($value, $element)
    {
        $this->wd->findElement(WebDriverBy::cssSelector($element))->sendKeys($value);

        return $this;
    }
314688
public function setElement(\Mmi\Form\Element\Checkbox $element = null)
    {
        return $this->setOption('element', $element);
    }
1260310
public function equals(WebDriverElement $other)
    {
        return $this->executor->execute(DriverCommand::ELEMENT_EQUALS, [
            ':id' => $this->id,
            ':other' => $other->getID(),
        ]);
    }
298504
public static function convertElement($element, RemoteWebDriver $driver)
    {
        if ($element instanceof RemoteWebElement) {
            return new self($element, $driver);
        }

        return $element;
    }
515526
public function addElement(Element $element): Element
    {
        if ($element instanceof FormStatus) {
            if ($this->hasStatus === true) {
                throw new InvalidArgumentException('Form can contain only one FormStatus element');
            }
            $this->hasStatus = true;
        }
        return parent::addElement($element);
    }
891199
public function renderElement($element)
    {
        if (is_string($element)) {
            if (($e = $this[$element]) === null && ($e = $this->getButtons()->itemAt($element)) === null) {
                return $element;
            } else {
                $element = $e;
            }
        }
        if ($element->getVisible()) {
            if ($element instanceof CFormInputElement) {
                if ($element->type === 'hidden') {
                    return TbHtml::tag('div', array('class' => 'hidden'), $element->render());
                }
            }
            return $element->render();
        }
        return '';
    }
1005127
public function click(string $selector = null): Element
    {
        if ($selector === null) {
            $element = $this->remote;
        } else {
            $element = $this->resolver->findOrFail($selector);
        }

        $element->click();

        return $this;
    }
1044029
public function release(WebDriverElement $element = null)
    {
        $this->action->addAction(
            new WebDriverButtonReleaseAction($this->mouse, $element)
        );

        return $this;
    }