Hi,  Bret and all

Last week, we found the method Watir::IE.each was not always work normally,
sometimes it could enter into the
sub routine, sometimes faild.

its code list as below in ie.rb

    def self.each
      shell = WIN32OLE.new('Shell.Application')
      shell.Windows.each do |window|
        next unless (window.path =~ /Internet Explorer/ rescue false)
        next unless (hwnd = window.hwnd rescue false)
        ie = IE.bind(window)
        ie.hwnd = hwnd
        yield ie
      end
    end


After debug every line code, and discovery this code window.path =~
/Internet Explorer/ return false, I have to puts the
window.path, and obviously it return true when window.path =~ /internet
Explorer/. there is difference between the Internet and internet.
so, we change the code like below in order to make the IE.each method works

    def self.eachie
      shell = WIN32OLE.new('Shell.Application')
      shell.Windows.each do |window|
        next unless (File.basename(window.fullname).downcase =~ /iexplore/
rescue false)
        next unless (hwnd = window.hwnd rescue false)
        ie = IE.bind(window)
        ie.hwnd = hwnd
        yield ie
      end
    end

The question is that I want to consult with you all and hope get your
analysis if the modified method cover all IE windows instance, and i can
always make the Watir::IE.eachie
work, or have any bad effect for others i can't evaluate?

Additionally, there are somecode like this

    frames = @container.document.frames

      for i in 0..(frames.length - 1)
        this_frame = frames.item(i)
        return this_frame when i==3
      end
  as we known, there are some object-set method in container.rb, such as
buttons, links, file_fields and the like.
we can make use of the buttons to return every button object and click it in
direct. In fact, I want to get the frames and
take it as really frame container and discover the web object  in it, but it
always return the ole object, how it make it work as the

really frame object? Or someone help me to produce a method called frames in
container.rb, or some suggestions for me?

Thanks,
-Wisotn

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to