public function getElement(string $name): Element
    {
        if ($this->page_object_factory === null) {
            throw new RuntimeException('[W406] To create elements you need to pass a factory with setPageObjectFactory()');
        }

        return $this->page_object_factory->createElement($name);
    }
public function getElement(string $name): Element
    {
        if ($this->page_object_factory === null) {
            throw new RuntimeException('[W406] To create elements you need to pass a factory with setPageObjectFactory()');
        }

        return $this->page_object_factory->createElement($name);
    }
public function getElement ( string $ name ) : Element { if ( $ this -> page_object_factory === null ) { throw new RuntimeException ( '[W406] To create elements you need to pass a factory with setPageObjectFactory()' ) ; } return $ this -> page_object_factory -> createElement ( $ name ) ; }
Creates a page object element from its name.

@param string $name The name of the page object element e.g 'Toolbar'

@throws \RuntimeException

@return Element
Creates a page object element from its name .