src/Utils/Wysiwyg/Wysiwyg.php
protected function getInstance($selector = '')
    {
        if (empty($this->object)) {
            throw new \RuntimeException('Editor instance was not set.');
        }

        if (empty($this->selector) && empty($selector)) {
            throw new \RuntimeException('No such editor was not selected.');
        }

        $this->setSelector($selector);

        if (empty($this->instances[$this->selector])) {
            $instanceId = $this->context->element('field', $this->selector)->getAttribute('id');
            $instance = sprintf($this->object, $instanceId);

            if (!$this->context->executeJs("return !!$instance")) {
                throw new \Exception(sprintf('Editor "%s" was not found.', $instanceId));
            }

            $this->instances[$this->selector] = $instance;
        }

        return $this->instances[$this->selector];
    }
protected function getInstance($selector = '')
    {
        if (empty($this->object)) {
            throw new \RuntimeException('Editor instance was not set.');
        }

        if (empty($this->selector) && empty($selector)) {
            throw new \RuntimeException('No such editor was not selected.');
        }

        $this->setSelector($selector);

        if (empty($this->instances[$this->selector])) {
            $instanceId = $this->context->element('field', $this->selector)->getAttribute('id');
            $instance = sprintf($this->object, $instanceId);

            if (!$this->context->executeJs("return !!$instance")) {
                throw new \Exception(sprintf('Editor "%s" was not found.', $instanceId));
            }

            $this->instances[$this->selector] = $instance;
        }

        return $this->instances[$this->selector];
    }
Get the editor instance for use in Javascript.

@param string $selector
Any selector of a form field.

@throws \RuntimeException
@throws \Exception
@throws \WebDriver\Exception\NoSuchElement

@return string
A Javascript expression that representing WYSIWYG instance.