Selenium无法在iframe中引发警报

编程入门 行业动态 更新时间:2024-10-09 23:14:07
本文介绍了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中引发警报

本文发布于:2023-11-27 18:00:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639029.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:警报   Selenium   iframe

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!