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();
If it is click cancel, then:
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();
If it is click cancel, then:
alert.dismiss();