When recording in selenium IDE I can click the \"OK\" button in a popup, and expected to be able to click it using
driver.findElement(By.linkText(\"OK\")).cl
if you are using latest version of webdriver, infact anything above 2.20 then
driver.switchTo().alert().accept();
should work provided the alert is a javascript alert similar to the one we get when we click
alert demo OR confirm pop-up demo
Updated
here this code will help you accept the alert
driver = new FirefoxDriver();
String baseUrl = "http://www.w3schools.com/js/tryit.asp?filename=tryjs_alert";
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.get(baseUrl);
driver.switchTo().frame(0);
driver.findElement(By.cssSelector("input[type=\"button\"]")).click();
driver.switchTo().alert().accept();