开发者

Using C# to simulate confirming a javascript popup

开发者 https://www.devze.com 2023-01-10 13:55 出处:网络
So I\'m trying to verify 开发者_Go百科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

So I'm trying to verify 开发者_Go百科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?


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.


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)

0

精彩评论

暂无评论...
验证码 换一张
取 消