title: Continue Selenium Test instead of Timeout in WebDriverWait
body: <p>i am using WebDriverWait in Selenium, i want to wait 10 second to wait if some Alert or Confirm box will appear, if it appears i will accept it. for example if confirm box ask me to "Leave Page" or "Stay on Page" then i want to leave page automatically, and if alert is not appeared in 10 seconds then continue code Excecution instead of throwing Exception. or you can tell me some way to accept All confirm, alert boxes automatically during whole selenium test. thanks
  here is my code </p>
  
  <pre><code>WebDriver driver = new FirefoxDriver();  
      driver.get("https:www.google.com");
      WebDriverWait wait = new WebDriverWait(driver, 10 );
      if(wait.until(ExpectedConditions.alertIsPresent())==null)
      {
      System.out.println("alert was not present");}
      else{
      Alert alert = driver.switchTo().alert(); 
      alert.accept();
      System.out.println("alert was present");}
  </code></pre>