Hi I am using the following code for handling the alert box after clicking an action but it isn’t working
Can somebody please help.
This is where I call the handler. clickOnAlert() after clickOnAddQuote() is called alert box appears.
System.out.println("before add to quote");
this.clickOnAddQuote();
System.out.println("before alert");
this.clickOnAlert();
System.out.println("after alert");
function clickOnAlert()
public void clickOnAlert() {
System.out.println("In click");
Alert alert = webdriverSession().switchTo().alert();
System.out.println("after constructor");
alert.accept();
}
Please help.
Thanks
different dialogs handling using selenium webDriver:
Hope it helps you:)