Selenium无法在iframe中引发警报 [英] Selenium cannot get alert thrown in iframe

查看:107
本文介绍了Selenium无法在iframe中引发警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用selenium RC C#函数getAlert()捕获警报,因为单击按钮时检查帐户ID的可用性。表单将从一个框架提交给服务器,比如说frame_A,服务器将通过JavaScript代码alert(帐户可用)响应到另一个名为frame_B的框架中,但不知何故,selenium getAlert()不能检测到警报的存在。



一直在寻找解决方案,但到目前为止还没有找到它。



任何帮助,将不胜感激。



谢谢

解决方案

你尝试使用selectFrame(frameId)方法尝试getAlert()之前选择iframe?
我不确定这是否能解决您的问题,但值得一试。谢谢

I am trying to capture the alert using selenium RC C# function getAlert() as a result of checking the availability of an account ID when the button is clicked. The form will be submitted to the server from one frame let's say "frame_A" and the server will response by javascript code "alert("The account is available")" into another frame called "frame_B" but somehow the selenium getAlert() cannot detect the existence of the alert.

Have been looking for solutions, but so far have not found it.

Any help, will be greatly appreciated.

Thanks

解决方案

Have you tried selecting the iframe before trying to getAlert() using selectFrame(frameId) method? I am not sure if this will solve your problem but worth giving a try. Thanks

这篇关于Selenium无法在iframe中引发警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆