Reputation: 21
I'm working in Selenium and want to click on an alert box or confirmation through Selenium code in Eclipse. How can I do this?
Upvotes: 2
Views: 636
Reputation: 3394
Alert alert = driver.switchTo().alert();
alert.accept();
On Pavel's suggestion adding the issue I faced with this -
http://code.google.com/p/selenium/issues/detail?id=3544
Note: The issue is random and the code worked for me most of the time. :)
Upvotes: 2