So I'm trying to verify the pop-ups occur in my Selenium 2 functional tests. Right now there seems to be no built-in way for selenium 2 to handle these. Is there a way to create C# code that will notice an alert, and simulate hitting the "Enter" key?
+1
A:
Webdriver does not handle javascript alerts yet. The issue is know and already has a defect created, you can monitor the status here http://code.google.com/p/selenium/issues/detail?id=27&colspec=ID%20Stars%20Type%20Status%20Priority%20Milestone%20Owner%20Summary
That page also has some work around using javascript that you can try.
Reflux
2010-08-03 20:11:16
Have you by chance tried the workarounds? I'm probably going to give a few of them a shot and see what happens.
James
2010-08-04 14:33:20
No I haven't sorry.
Reflux
2010-08-04 15:05:50
A:
Generally, handling pop-ups is a pretty hard thing.. the only framework I know of that handles them is WatiN & it really takes lots of time to handle them (it might take it over 30 sec to find a pop-up)
Shady M. Najib
2010-08-03 22:48:39
Actually Selenium 1 handles Alerts. However in the .net version of Selenium 2 WebDriverBackedSelenium doesn't seem to be working.
Reflux
2010-08-04 12:24:33