Selenium cannot get alert thrown in iframe

隐身守侯 提交于 2019-12-24 20:35:00

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/5320413/selenium-cannot-get-alert-thrown-in-iframe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!