title: How to wait for an alert in Selenium webdriver ?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7076758/selenium-2-4-0-how-to-check-for-presence-of-an-alert">selenium 2.4.0, how to check for presence of an alert</a>  </p>
  </blockquote>
  
  
  
  <p>I am using the following code to close the alert window :</p>
  
  <pre><code>Alert alert3 = driver.switchTo().alert();
  alert3.dismiss();
  </code></pre>
  
  <p>The alert appears a few seconds after the opening of the main window.</p>
  
  <p>How can I wait and check if alert appears ?</p>