src/ElementResolver.php
public function findOrFail($selector)
    {
        if (! is_null($element = $this->findById($selector))) {
            return $element;
        }

        return $this->driver->findElement(
            WebDriverBy::cssSelector($this->format($selector))
        );
    }
public function findOrFail($selector)
    {
        if (! is_null($element = $this->findById($selector))) {
            return $element;
        }

        return $this->driver->findElement(
            WebDriverBy::cssSelector($this->format($selector))
        );
    }
public function findOrFail ( $ selector ) { if ( ! is_null ( $ element = $ this -> findById ( $ selector ) ) ) { return $ element ; } return $ this -> driver -> findElement ( WebDriverBy :: cssSelector ( $ this -> format ( $ selector ) ) ) ; }
Find an element by the given selector or throw an exception.

@param  string  $selector
@return \Facebook\WebDriver\Remote\RemoteWebElement
Find an element by the given selector or throw an exception .