public void
handleWindowsPopup() throws InterruptedException, AWTException {
driver=new
FirefoxDriver();
driver.get("http://www.google.co.in");
driver.findElement(By.id("gbqfq")).sendKeys("java
download");
Thread.sleep(3000);
driver.findElement(By.id("gbqfb")).click();
Thread.sleep(5000);
driver.findElement(By.xpath("//h3[@class='r']/a")).click();
Thread.sleep(5000);
driver.findElement(By.xpath("//a[@class='jvdla0']")).click();
Thread.sleep(5000);
driver.findElement(By.xpath("//a[@class='jvdla0']")).click();
Thread.sleep(5000);
Robot robot=new Robot();
robot.keyPress(KeyEvent.VK_TAB);
Thread.sleep(2000);
robot.keyPress(KeyEvent.VK_ENTER);
Thread.sleep(5000);
//driver.quit();
}