Starting with Selenium 2.0 beta 1, there is built in support for handling popup
dialog boxes. After you’ve triggered an action that opens a
popup, you can access the alert with the following:
Alertalert=driver.switchTo().alert();
This will return the currently open alert object. With this object you can now accept,
dismiss, read its contents or even type into a prompt. This interface works equally
well on alerts, confirms, and prompts. Refer to the JavaDocs
or RubyDocs for more information.
No comments:
Post a Comment