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."
                );
            }
        }
    }