sorry for my last post, ie.ie.stop really works. here is my code snippets, ie would be stoped when the readyState is interactive. require 'rubygems' require 'watir' require 'watir/ie'
ie = Watir::IE.new ie.maximize @thread = Thread.new do loop do sleep 0.5 p ie.document.readyState if (ie.document.readyState =~ /interactive/) ie.ie.stop break end end end ie.goto 'www.google.com' On Sat, Aug 8, 2009 at 10:07 AM, bao bao <btb8...@gmail.com> wrote: > Thanks for your reply. > I don't think there is such method(ie.ie.stop) > My ruby version 1.8.6 and watir version is 1.6.2. > Is there any other soultion? > > > > > On Sat, Aug 8, 2009 at 12:28 AM, Michael Hwee <michael_h...@yahoo.com>wrote: > >> >> Try ie.ie.stop >> >> >> >> ----- Original Message ---- >> From: Alex.Dev <btb8...@gmail.com> >> To: Watir General <watir-general@googlegroups.com> >> Sent: Friday, August 7, 2009 2:01:38 AM >> Subject: [wtr-general] stop ie from code >> >> >> I tried to open a very slowly website, i want to stop it(like click >> stop button in toolbar, but i need to do this from code) when it's >> readState is interactive. >> >> here is my code snippets: >> >> require 'rubygems' >> require 'watir' >> require 'watir/ie' >> >> >> ie = Watir::IE.new >> ie.speed =:fast >> >> >> @thread = Thread.new do >> loop { >> sleep 0.5 >> if (ie.document.readyState =~ /interactive/) >> #stop ie and break the loop, now the problem is how to >> complete the code >> #like ie.abort, but there is no this method. >> end >> } >> end >> >> >> ie.goto 'http://www.flickr.com/' >> >> Regards, >> Alex.Dev >> >> >> >> > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---