IE browser doesn't close and file download popup needs focus

Posted by jkranthi on Stack Overflow See other posts from Stack Overflow or by jkranthi
Published on 2010-06-17T03:03:24Z Indexed on 2010/06/17 3:13 UTC
Read the original article Hit count: 358

Filed under:
|

Hii all ,

I am trying to to click on a link after it is active which again produces a popup ( file download) after clicking. Here i have 2 problems

1) I start the code and leave it .what the code does is -after long process -it waits for the link to be active .Once the link is active it clicks on the link and a download popups opens (if everything goes well) and then it hangs there ( showing yellow flashing in the task bar which mean i have to click on the explorer for it to process whatever is next ).every time i have to click on the IE whenever the download popup appears .Is there a way to handle this or am i doing some wrong ?

2) The next problem is even if i click on the IE .the IE doesn't get close even though i write ie.close . my code is below :

                       ## if the link is active
                    ie.link(:text,a).click_no_wait
                     prompt_message = "Do you want to open or save this file?"
                     window_title = "File Download"
                     save_dialog =WIN32OLE.new("AutoItX3.Control")
                       save_dialog.WinGetText(window_title)

                       save_dialog_obtained =save_dialog.WinWaitActive(window_title)
                        save_dialog.WinKill(window_title)
                      # end
                      #'
                       #some more code -normal puts statements
                      #

                    ie.close

ie is hanging up for some strange reason ..?

© Stack Overflow or respective owner

Related posts about watir

Related posts about autoit