Selenium 2.* is running on Linux with Firefox as the browser.
I am using perl with the Selenium::Remote::Driver module to interact with the server.
Is there anything available to check if an alert is present? The perl module provides several functions to click OK on an alert, or to get the text from it, but this will raise an error if there is no alert - how to avoid an error and still get rid of any alert?
Basically, I want to remove all alerts when a page finished loading (if any), but not sure how?
Another option that I tried is disabling all alerts by setting a variable in the firefox profile (which works when you use the browser yourself), but somehow the alert is still there when the browser is used by Selenium because i think Selenium handles the alert itself because of the "handlesAlerts" capability, which is always set to true, and I'm not sure how to disable it. It may be the solution if it's not possible to check for the existence of an alert.
Anyone have an idea?