How to handle the alert message when its parent window is closed

89 views
Skip to first unread message

Ying geri

unread,
Sep 20, 2013, 11:45:09 AM9/20/13
to robotframe...@googlegroups.com
In my test, I have a main window and then click a button will cause another window pops up.  Then in the popup window, after I click the submit button, the popup window will be close and alert message will be showed. My test failed at here, it can't recognize the alert window. any idea for how to test it?
 
 
Thanks
 
 

Kevin O.

unread,
Sep 21, 2013, 1:47:03 AM9/21/13
to robotframe...@googlegroups.com
Hi Ying,

Someone else had the same problem as you in this group but I cannot find the post.
I do remember the issue, though.
With Internet Explorer, Selenium "sees" the alert as belonging to the parent window when showModalDialog was used and the child window calls alert. This is either unreported or unfixed.
Try selecting the parent window or selecting the root window by calling Select Window with no arguments before trying to handle the alert.

Kevin

Geri

unread,
Sep 21, 2013, 9:09:50 PM9/21/13
to robotframe...@googlegroups.com
Hi Kevin,

I tried to select the root window but failed and can't select the parent window either because it is closed already.  And at this time even Close All Browsers doesn't work either. looks like can't recognize the browser. :(

Kevin O.

unread,
Sep 22, 2013, 2:41:55 PM9/22/13
to robotframe...@googlegroups.com
If the parent closed before the child, it must not have been opened modally.
I'm not sure what to do in this scenario.

sabbir hossain

unread,
Sep 23, 2013, 12:44:58 AM9/23/13
to robotframe...@googlegroups.com

hi Geri,

If it is only a alert message and you have to click on OK then you can use "Press Key Native " key word and argument "27 or 10" it will work as press enter button.

Cheers
Reply all
Reply to author
Forward
0 new messages