WebDriver/WebDriver/Object/Alert.php
public function wait($timeout = 30)
    {
        $lastException = null;
        for ($i = 0; $i < $timeout; $i++) {
            try {
                $this->text();
                return $this;
            } catch (WebDriver_Exception $e) {
                $lastException = $e;
                sleep(1);
            }
        }

        if (null !== $lastException) {
            throw $lastException;
        }

        return $this;
    }
public function wait($timeout = 30)
    {
        $lastException = null;
        for ($i = 0; $i < $timeout; $i++) {
            try {
                $this->text();
                return $this;
            } catch (WebDriver_Exception $e) {
                $lastException = $e;
                sleep(1);
            }
        }

        if (null !== $lastException) {
            throw $lastException;
        }

        return $this;
    }
public function wait ( $ timeout = 30 ) { $ lastException = null ; for ( $ i = 0 ; $ i < $ timeout ; $ i ++ ) { try { $ this -> text ( ) ; return $ this ; } catch ( WebDriver_Exception $ e ) { $ lastException = $ e ; sleep ( 1 ) ; } } if ( null !== $ lastException ) { throw $ lastException ; } return $ this ; }
Waits for an alert to appear.

@param int $timeout
@return $this
@throws WebDriver_Exception
Waits for an alert to appear .