protected function findByValue($value, $element = 'input')
    {
        try {
            return $this->session->element('css selector', "{$element}[value='{$value}']");
        } catch (NoSuchElement $e) {
            try {
                return $this->session->element('xpath', "//button[contains(text(),'{$value}')]");
            } catch (NoSuchElement $e) {
                throw new InvalidArgumentException(
                    "Crap. Couldn't find an {$element} with a 'value' attribute of '{$value}'. We also looked " .
                    "for a button that contains the text, '{$value}', but no dice either."
                );
            }
        }
    }
protected function findByValue($value, $element = 'input')
    {
        try {
            return $this->session->element('css selector', "{$element}[value='{$value}']");
        } catch (NoSuchElement $e) {
            try {
                return $this->session->element('xpath', "//button[contains(text(),'{$value}')]");
            } catch (NoSuchElement $e) {
                throw new InvalidArgumentException(
                    "Crap. Couldn't find an {$element} with a 'value' attribute of '{$value}'. We also looked " .
                    "for a button that contains the text, '{$value}', but no dice either."
                );
            }
        }
    }
protected function findByValue ( $ value , $ element = 'input' ) { try { return $ this -> session -> element ( 'css selector' , "{$element}[value='{$value}']" ) ; } catch ( NoSuchElement $ e ) { try { return $ this -> session -> element ( 'xpath' , "//button[contains(text(),'{$value}')]" ) ; } catch ( NoSuchElement $ e ) { throw new InvalidArgumentException ( "Crap. Couldn't find an {$element} with a 'value' attribute of '{$value}'. We also looked " . "for a button that contains the text, '{$value}', but no dice either." ) ; } } }
Find an element by its "value" attribute.

@param  string $value
@param  string $element
@return \Session
Find an element by its value attribute .