src/Services/WaitForElement.php
protected function waitForElementWithXPath($xpath, $timeout = 2000)
    {
        try {
            $this->waitForElement('XPath', $xpath, $timeout);
        } catch (\Exception $e) {
            throw new CannotFindElement("Can't find an element with an XPath of "
                .$xpath.' within the time period of '.$timeout.' miliseconds');
        }

        return $this;
    }
protected function waitForElementWithXPath($xpath, $timeout = 2000)
    {
        try {
            $this->waitForElement('XPath', $xpath, $timeout);
        } catch (\Exception $e) {
            throw new CannotFindElement("Can't find an element with an XPath of "
                .$xpath.' within the time period of '.$timeout.' miliseconds');
        }

        return $this;
    }
protected function waitForElementWithXPath ( $ xpath , $ timeout = 2000 ) { try { $ this -> waitForElement ( 'XPath' , $ xpath , $ timeout ) ; } catch ( \ Exception $ e ) { throw new CannotFindElement ( "Can't find an element with an XPath of " . $ xpath . ' within the time period of ' . $ timeout . ' miliseconds' ) ; } return $ this ; }
Helper method to wait for an element with the specified xpath.

@param $xpath
@param int $timeout

@throws CannotFindElement

@return $this
Helper method to wait for an element with the specified xpath .