views:

25

answers:

1

I have a survey web-app that is public facing. I want to set up automated testing with Selenium, but selenium can't capture javascript alerts that we're currently using on the site.

I'm thinking about changing our user-facing error notifications to some web 2.0 javascript library so that it is accessible to Selenium. However, I'm not sure how many of our users would be able to experience them properly. How backwards-compatible do I need to be in the present day?

I have collected a database of actual user-agent strings of our users. I asked here how I could group them into meaningful data about what browsers our users are actually using.

A: 

storeAlert ( variableName ) Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts.

Getting an alert has the same effect as manually clicking OK. If an alert is generated but you do not consume it with getAlert, the next Selenium action will fail.

Under Selenium, JavaScript alerts will NOT pop up a visible alert dialog.

Selenium does NOT support JavaScript alerts that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until someone manually clicks OK.

Returns: The message of the most recent JavaScript alert

01