public function waitForAlert($timeout = 60)
	{
		$result = FALSE;
		$i = 0;
		do
		{
			sleep(1);
			try
			{
				$result = $this->alertText();
			}
			catch (\RuntimeException $e)
			{
				;
			}
		} while (++$i < $timeout && $result === FALSE);
		return $result;
	}
public function waitForAlert($timeout = 60)
	{
		$result = FALSE;
		$i = 0;
		do
		{
			sleep(1);
			try
			{
				$result = $this->alertText();
			}
			catch (\RuntimeException $e)
			{
				;
			}
		} while (++$i < $timeout && $result === FALSE);
		return $result;
	}
public function waitForAlert ( $ timeout = 60 ) { $ result = FALSE ; $ i = 0 ; do { sleep ( 1 ) ; try { $ result = $ this -> alertText ( ) ; } catch ( \ RuntimeException $ e ) { ; } } while ( ++ $ i < $ timeout && $ result === FALSE ) ; return $ result ; }
Wait for javascript alert, prompt or confirm dialog.

@param int $timeout Patience in seconds.
@return string|bool Alert text, or FALSE if waiting times out.
Wait for javascript alert prompt or confirm dialog .