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();
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();
暂无评论。
评论功能维护中,当前仅展示历史评论。