对了, 只能在ie上可以看到这个link,其他浏览器上没有的
附上一点脚本,请大家继续。。。。。
WebDriver driver = new InternetExplorerDriver();
String baseurl = "http://xin.msn.com/?lang=en-sg";
driver.get(baseurl);
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
driver.findElement(By.linkText("Make xinmsn my homepage")).click();
Alert alert = driver.switchTo().alert();
if(!alert.getText().equalsIgnoreCase("Would you like to use the following as your home page?")){
System.out.println("DHP alert not popup, pls check...");
}
//请继续。。。。。。
对了, 只能在ie上可以看到这个link,其他浏览器上没有的
附上一点脚本,请大家继续。。。。。
WebDriver driver = new InternetExplorerDriver();
String baseurl = "http://xin.msn.com/?lang=en-sg";
driver.get(baseurl);
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
driver.findElement(By.linkText("Make xinmsn my homepage")).click();
Alert alert = driver.switchTo().alert();
if(!alert.getText().equalsIgnoreCase("Would you like to use the following as your home page?")){
System.out.println("DHP alert not popup, pls check...");
}
//请继续。。。。。。