public function wait($timeout, $condition)
    {
        $conditionResult = false;
        while ($timeout > 0 && true !== $conditionResult) {
            usleep(100);
            $timeout -= 100;

            // don't throw exceptions
            try {
                $conditionResult = $this->con->evaluateJavascript($condition);
            } catch (\Exception $e) {
                $conditionResult = false;
            }
        }

        return (boolean) $conditionResult;
    }
public function wait($timeout, $condition)
    {
        $conditionResult = false;
        while ($timeout > 0 && true !== $conditionResult) {
            usleep(100);
            $timeout -= 100;

            // don't throw exceptions
            try {
                $conditionResult = $this->con->evaluateJavascript($condition);
            } catch (\Exception $e) {
                $conditionResult = false;
            }
        }

        return (boolean) $conditionResult;
    }
public function wait ( $ timeout , $ condition ) { $ conditionResult = false ; while ( $ timeout > 0 && true !== $ conditionResult ) { usleep ( 100 ) ; $ timeout -= 100 ; // don't throw exceptions try { $ conditionResult = $ this -> con -> evaluateJavascript ( $ condition ) ; } catch ( \ Exception $ e ) { $ conditionResult = false ; } } return ( boolean ) $ conditionResult ; }
Waits for timeInMilliseconds ms or till the condition is satisfied on the browser,
which ever is sooner.

@param integer $timeout   timeout in milliseconds
@param string  $condition JS condition

@return boolean
Waits for timeInMilliseconds ms or till the condition is satisfied on the browser which ever is sooner .