Selenium WebDriver – Handling JavaScript Popups
public class HandlingPopup {
static WebDriver driver = new FirefoxDriver();
public static void Handle(){
//switching focus to alert box
Alert alert =driver.switchTo().alert();
//Get text from the alert box
System.out.println(alert.getText());
//click on Ok
alert.accept();
//cancel the popup
driver.quit();
public static void main(String args[]){
Handle();
}
}
public class HandlingPopup {
static WebDriver driver = new FirefoxDriver();
public static void Handle(){
//switching focus to alert box
Alert alert =driver.switchTo().alert();
//Get text from the alert box
System.out.println(alert.getText());
//click on Ok
alert.accept();
//cancel the popup
driver.quit();
public static void main(String args[]){
Handle();
}
}
< a href " https://astrologyrays.com/ " > Best Astrologer in Jaipur
ReplyDelete