0

This is what I want to do Click in OK button inside an Alert (Selenium IDE)

But the answers in the above question doesn't work when alerts pop up on load. How can I click OK button inside an Alert when the alerts pop up on load?

Community
  • 1
  • 1
Boten Uno
  • 3
  • 1

1 Answers1

0

In selenium, alerts are handled as an Alert object. You can use Alert(driver).accept() to accept the alert prompt or Alert(driver).dismiss() to dismiss it -- You can also provide input for authentication alerts or use the send_keys method on an alert. (see linked docs for more detail)

Selenium also has expected condition support for alerts so you can programatically check if an alert is present.

You can see more details in this previously addressed question

Also, be careful when you lookup selenium documentation. Python is not the only way to use Selenium and the syntax is different from using, for example, the firefox IDE. Just be sure you're looking for Python examples and docs.

Community
  • 1
  • 1
sytech
  • 29,298
  • 3
  • 45
  • 86