Sorry for confusing, The IE.each was fail , when the IE was called as internet explorer for window.path since window.path =~ /Internet Explorer/ is not treated the case sentive.
I changed it as (File.basename(window.fullname).downcase =~ /iexplore.exe/ instead of the former. I want to suggest that it be applied for watir api?and I am afraid that it have another bad effect that i have not evaluated? Both two methods were fail at same times, when you open the ( http://images.china-pub.com/ebook30001-35000/34807/ch12.pdf as an IE alive instance, which result in the IE.each can 't work at all. have some one run into the same issue? Thanks. -Wiston > 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 > 2008/10/27 Bret Pettichord <[EMAIL PROTECTED]> > > Wiston, > > You said the IE.each method was failing in certain circumstances. Can > you give us more information about the circumstances in which it was > failing? > > Also in your report you said that you changed window.path (changing the > case), but the code you provided actually changed to using > window.fullname. So your explanation does not match the code example you > provided. > > I would like to understand more about the problem you've been > researching so we can provide an adequate solution. > > Bret > > > bugs apple wrote: > > 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? > > > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---