title: handling pop up with many buttons using selenium webdriver
body: <p>I'm using selenium web driver with Java language. when there are two buttons in a pop up i.e. ok and cancel  , it can be easily handled with web driver using the following code:</p>
  
  <pre><code>Alert alert = driver.switchTo().alert();
  alert.accept(); // or alert.dismiss(); depending upon the action u want to perform.
  </code></pre>
  
  <p>but what to do when there are more than two button, i.e. there are 3 to 4 buttons in the pop up ( e.g. like ok,cancel,try again, ignore/continue), in that case what do we do? how can we click on whichever button that we want?</p>
  
  <p>Thank you very much for your help in advance </p>