Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
354 views
in Selenium by
recategorized by
How do I handle alerts in Selenium WebDriver Java, especially the alerts which occurs unexpectedly.

1 Answer

0 like 0 dislike
by The go-to Tester (327 points)
selected by
 
Best answer
To handle alert you can use below code.

driver.switchTo().alert().accept();


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...