Title: Blocking popup window?

I think you need to split off a separate thread for the popup detection.

Basically, you have the popup checker running in a loop in a separate thread from the links being clicked.

 

So in pseudo code:

 

A=Thread.new(method_that_loops_through_links)

B=thread.new(method_that_clicks_pop_ups)

Join.A

Join.B

 

My threading knowledge is next to zip, be sure to read up in the FAQ on more of this. I would also recommend upgrading your version on Watir to the latest.

 

-Mike

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Wednesday, May 24, 2006 2:34 PM
To: '[email protected]'
Subject: [Wtr-general] Blocking popup window?

 

Hello all,

I use watir version 1.4.1.

My script finds certain links and adds them in an array and then follows each of the links (see code below). However I get once in a while a IE popup window "Do you want to save changes: OK, CANCEL". However ie.goto(link) blocks the progress of the script and so the next line never gets executed.

What is a proper way of dealing with the pop-up window?

Thanks,
Bernd

 

 mainnav.each do |m|           
            ie.goto(m)
            #
            # why sometimes the "Do you want to save changes" dialog box appears I don't know
            # but let's deal with it
            popup.clickWindowsButton("Microsoft Internet Explorer", "CANCEL" , maxWaitTime=20 )
end

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to