Check, Thanks for the details solutions.

In general - i can say that this in not a "general bug" in the
firewatir code" - in fact firewatir does find elements of objects in
frames - most of the time!

Now comes what I have found out until now. After a lot debugging and
running after phantom bugs - i have finally found out what is at the
root of the problem.
It lies in the html code on the page:

<form method="get" name="lay0803234_src350a"
action="snippet_freie_stellen_ergebnis.htm"/>

Note the close slash /> at the end of the statement which closes the
form statement.

In the html code, this statement is followed by the select lists,
inputs and buttons etc.

On the face of it, this seems wrong - according to everything I have
seen until now the </form> statement should come after the all the
form elements (select lists, buttons and inputs etc) have been
declaired (but I am not an html guru - so I am not sure about this).

What is interesting is that firefox iteself can deal with this - the
form is displayed correctly and works fine. In fact looking at the DOM
with firebug firefox knows everything about the elements of the form
object. Unfortunately firewatir cannot get hold of the information for
some reason and I am not a javascript guru - I cannot figure it what
is going wrong. - but I have made these observations:

1. ff.frame(:index, 1).froms
    The above statement uses the firewatir "locate_tagged_elements" to
find the forms. This method will not find any form that which closes
on itself. i.e. <form name="hello"/>

2. ff.frame(:index, 1).form(:index, 1).name
   This uses "locate_tagged_element" to find the form. This will
locate a form that closes on iteself.

3. ff.frame(:index, 1).form(:index, 1).selects_lists
   This (logically - will not find any select lists in the form).

4. ff.frame(:index, 1).form(:index, 1).select_list(:index, 1).name
   This (unlogically) does not find the select list for the form that
closes on itself.

Has any one any idea why the javascript code being sent to firefox
through jssh is not working properly (not finding the things) in a
case like this. Note the url of the page causeing this is:

http://www.siemens.de/jobs/jobs_bewerbung/jobboerse/Seiten/jobboerse.aspx

I small note on this and the conditions that i have to work in (god
given):

1. I cannot use IE or watir
2. I can only use Firefox and firewatir
3. I cannot tell the programmer to change the code.
4. I need the contents of forms

Any brillinat ideas out there??

Please let me know.

Thanks a million

Jason.


















On 5 Jun., 20:37, Chuck van der Linden <sqa...@gmail.com> wrote:
> Ok I've not tried this, but as far as I know you COULD install the
> watir gem, you just could not run it with the browser set to IE since
> yes obviously you don't have an IE browser on your platform.
>
> Mostly I gave that as an easy way to provide a tiny bit of sample code
> where you could quickly show (on a windows system) that the script
> worked on IE and not on Firefox, which helps to isolate the source of
> the bug (although I see you already found the code that needs to
> change)..
>
> I do feel compelled to ask one question however.. the site you are
> testing, is it restricted to only users of firefox, or is it a public
> site accesable by multiple browsers?  if the latter shouldn't you be
> testing that it renders and operates properly on more than a single
> browser platform?  Perhaps by using a Virtual Machine to run Windows
> so you could test against IE?  or using chromewatir or safariwatir as
> well?  (presuming you want to test on the smaller marketshare
> browsers)   I would think testing the site against what only a portion
> of people use to browse the web (presuming we believe these folks
> <http://marketshare.hitslink.com/browser-market-share.aspx?qprid=1> FF
> is only about aquarter of users (seems low, but I can't find other
> stats just now)).  In any case regardless of the exact marketshare
> numbers, single browser testing leaves you open for a number of
> potential problems on other platforms.
>
>  (I run all my testbed systems off VM's.. I can tell you that IE and
> Watir both run fine from one, at least under Hyper-V..   I've not
> tried other platforms, but I've no reason to expect that VMWare or
> another virtualization platform would not work equally well)
>
> On Jun 4, 1:05 am, 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 -- 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to