`

selenium 点击alert

阅读更多

 

 

OK, Show you the code:

1 driver.findElement(By.id("updateButton")).click();
2 //pop up with id "updateButton" opens
3 Alert alert = driver.switchTo().alert();
4 //update is executed
5 alert.accept();

如果是点取消,则:

alert.dismiss();

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics