Selenium cannot get alert thrown in iframe

2019-08-27 04:08发布

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条回答
趁早两清
2楼-- · 2019-08-27 05:05

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

查看更多
登录 后发表回答