Wednesday 16 January 2013

How to handle the Javascript alert in Selenium Webdriver?

How to handle the Javascript alert in Selenium Webdriver?


Use the Below Code:

Alert alert = driver.switchTo().alert();
alert.accept();                         //For Clicking OK 
//alert.cancel();                       For Clicking CANCEL

No comments:

Post a Comment