src/Services/InteractWithPage.php
private function typeBySelectorType($type, $value, $name, $clear = false)
    {
        $element = $this->wd->findElement(WebDriverBy::{$type}($name));

        if ($clear) {
            $element->clear();
        }

        $element->sendKeys($value);

        return $this;
    }
private function typeBySelectorType($type, $value, $name, $clear = false)
    {
        $element = $this->wd->findElement(WebDriverBy::{$type}($name));

        if ($clear) {
            $element->clear();
        }

        $element->sendKeys($value);

        return $this;
    }
private function typeBySelectorType ( $ type , $ value , $ name , $ clear = false ) { $ element = $ this -> wd -> findElement ( WebDriverBy :: { $ type } ( $ name ) ) ; if ( $ clear ) { $ element -> clear ( ) ; } $ element -> sendKeys ( $ value ) ; return $ this ; }
Abstraction for typing into a field with a specific selector type.

@param $type - one of 'Name', 'Id', 'CssSelector'
@param $value - value to enter into form element
@param $name - value to use for the selector $type
@param bool $clear - Whether or not to clear the input first on say an edit form

@throws CannotFindElement

@return $this
Abstraction for typing into a field with a specific selector type .