public static void main(String[] args) throws InterruptedException {
WebDriver driver = new FirefoxDriver();
String Url = "http://sislands.com/coin70/week1/dialogbox.htm";
driver.get(Url);
WebElement alert = driver.findElement(By.xpath("///div[1]/center/table/tbody/tr/td/form[1]/p/input"));
alert.click();
Alert popup = driver.switchTo().alert();
System.out.println(popup.getText());
popup.accept();
Thread.sleep(3000);
driver.close();
}
String Url = "http://sislands.com/coin70/week1/dialogbox.htm";
driver.get(Url);
WebElement alert = driver.findElement(By.xpath("///div[1]/center/table/tbody/tr/td/form[1]/p/input"));
alert.click();
Alert popup = driver.switchTo().alert();
System.out.println(popup.getText());
popup.accept();
Thread.sleep(3000);
driver.close();
}