ok - so just for documentations sake i found the bug in the firewatir "locate_tagged_element" code in MozillaBaseElement.rb
this...... if(@container.class == FireWatir::Firefox || @container.class == Frame) needs to be changed to this..... if(@container.class == FireWatir::Firefox || @container.class == Frame || @container.container.class == FireWatir::Firefox || @container.container.class == Frame) There are three places in the method where this needs to be changed and :container needs to be added to the list of attr_accessors in the classes Frame and Form. I hope this helps for anyone with the same issue. I cannot believe that has not cropped up until now - it is such a basic bug. anyway I will post this in my bug report too. Jason. On 4 Jun., 10:05, jason <jason.franklin.sto...@gmail.com> wrote: > Chuck, > > Thanks a lot for your thoughs. > > Of course you are right with the work around - but this does not work > for me because I have a large number of sites that often change so I > don't know / cannot rely on the structure of the websites - my program > has to find this out for itself and operate the forms accordingly and > make sure they produce a valid output - which is an impossible task if > it is not clear which elements belong to which forms and where they > are in the frames and or nested frames. > > In the example i gave there are 6 select lists and 3 forms in 2 > different frames - which is a pretty common case - and regardless if i > use :name, :index :id or any other attribute to locate the select list > in the example - it does not work. > > I have posted this as a bug in the jira system eventhough I am still > trying to find out if this is a bug - or I am missing something - the > thing is - if this is a bug - then it looks like a show stopper for me > - but a bug that probably wont be fixed for some time to come - so > either i stop the project or debug / patch firewatir - which i would > totally like to avoid. > > You also mentioned this as a workaround > > > require 'watir' > > Watir::Browser.default = 'ie' #sets browser preference > > I cannot install watir becasue it requires a windows environment - or > I am I missing somthing here too? > > please let me know. > > thanks a million > > jason. > > On 3 Jun., 21:00, Chuck van der Linden <sqa...@gmail.com> wrote: > > > Hey I know you want to look for the select_list INSIDE the form, > > (perhaps to verify it's in the right 'place' within the dom etc) but > > if the intent is to manipulate the list, and you are able to identify > > it by ID value, then as a workaround until this problem is corrected, > > why not just leave out the form and look for it inside the frame? > > > I mean given that you are identifying it by ID and not Name or Class, > > there should only be ONE of them on the page if it's proper HTML. > > > Yes this doesn't let you validate that someone didn't move the thing > > outside of the form, or address any other reason you have for wanting > > to look for it 'inside' the form (which I understand perfectly, I do > > that kind of thing all the time with navigation links within a > > specific div etc) but it might at least let you get around this for > > now.. (and beats the heck out of having to setup a windows VM or > > something just so you can run the scripts) > > > It also seems to me like you've got a pretty valid (and thanks to the > > public site, easily reproducable) bug here, so you might want to > > create a Jira item for it to see that it gets fixed <http:// > > jira.openqa.org/browse/WTR> > > > FWIW I think this code should run on either browser with a simple > > change of the default browser value > > > require 'watir' > > Watir::Browser.default = 'ie' #sets browser preference > > url = "http://www.siemens.de/jobs/jobs_bewerbung/jobboerse/Seiten/ > > jobboerse.aspx" > > browser = Watir::Browser.new > > browser.goto(url) > > browser.frame(:index, 1).form(:name, "lay0803234_src350a").select_list > > (:id, "LOV6") .inspect > > > --Chuck > > On Jun 3, 10:25 am, jason <jason.franklin.sto...@gmail.com> wrote: > > > > Aidy. thanks for the feedback!! > > > > ff.table(:index, 1).rows[0].html > > > > is the same as > > > > ff.table(:index, 1).row(:index, 1).html > > > > rows[0] refers to the first element of the array as row(:index, 1) > > > referers to the location of the first row in the dom using the > > > locate_taged_element method. > > > > however - i see you have access to both IE and Firefox. could you > > > please please run this code and tel me if you get the same results as > > > i do?? > > > > This should work for IE and Firefox (watir and firewatir) > > > > url = "http://www.siemens.de/jobs/jobs_bewerbung/jobboerse/Seiten/ > > > jobboerse.aspx" > > > ff = FireWatir::Firefox.new > > > ff.goto(url) > > > ff.frame(:index, 1).form(:name, "lay0803234_src350a").inspect > > > > This should only work for IE: (watir only) > > > > url = "http://www.siemens.de/jobs/jobs_bewerbung/jobboerse/Seiten/ > > > jobboerse.aspx" > > > ff = FireWatir::Firefox.new > > > ff.goto(url) > > > ff.frame(:index, 1).form(:name, "lay0803234_src350a").select_list(:id, > > > "LOV6") .inspect > > > > Thanks a million.... > > > > On 3 Jun., 17:03, aidy lewis <aidy.le...@googlemail.com> wrote: > > > > > Hi Jason > > > > > How then would you explain this? > > > > > require 'rubygems' > > > > require 'watir' > > > > > ['watir', 'firewatir'].each { | g | require g } > > > > ie = Watir::IE.new > > > > ff = FireWatir::Firefox.new > > > > [ie, ff].each { |b| b.goto("http://www.google.com") } > > > > ff.table(:index, 1).rows[0].html > > > > ie.table(:index, 1).rows[0].html > > > > > Aidy > > > > > 2009/6/3 jason <jason.franklin.sto...@gmail.com>: > > > > > > firewatir index for all elements starts and frames starts with 1 > > > > > index 0 should be the root document (but its not :-( ) > > > > > so thanks for the thought > > > > > jason.- Hide quoted text - > > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---