title: To Handle Popup message in selenium webdriver
body: <p>I am trying to click OK button on the popup window with the below selenium Webdriver code</p>
  
  <pre><code>driver.switchTo().alert().accept();
  </code></pre>
  
  <p>but i am geeting the Bellow error</p>
  
  <p>org.openqa.selenium.NoAlertPresentException: No alert is present (WARNING: The server did not provide any stacktrace information)
  Command duration or timeout: 2.22 seconds
  Build info: version: '2.28.0', revision: '18309', time: '2012-12-11 20:21:45'
  System info: os.name: 'Windows 2003', os.arch: 'x86', os.version: '5.2', java.version: '1.6.0_21'
  Session ID: ddceb914-d74e-44c4-a159-9f1f591e7be1
  Driver info: org.openqa.selenium.firefox.FirefoxDriver</p>
  
  <p>here is the screenshot of the window</p>
  
  <p><img src="https://i.stack.imgur.com/CjRNB.png" alt="PopUpMessage"></p>