Showing posts with label Javascript alert in Selenium Webdriver. Show all posts
Showing posts with label Javascript alert in Selenium Webdriver. Show all posts

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