Hey Carl,
   In finding elements, my method is to use the least specific, unique
identifier. That is to say, while you could specify the entire nested DOM
structure to the element you want - browser.frame.frame.table.div.div.etc -
it's tedious and not necessary. You do have to specify frames, but not much
else.

 For your example, it looks like you could use something like this, though I
only see an unnested frame in your DOM:

@ie.frame("sectionFrame").frame("mainFrame").table(:class,
'topSubMenuBar')[1][1].link(:index, 1).click

You should be able to ignore the spans, divs, and other containers since the
table is uniquely identified by its class. Does that help?


Charley Baker
blog: http://charleybakersblog.blogspot.com/
Project Manager, Watir, http://wtr.rubyforge.org
QA Architect, Gap Inc Direct


On Fri, Jan 2, 2009 at 11:51 AM, [email protected] <
[email protected]> wrote:

>
> Hello everyone,
>
> I am moving to a new project.  I am first to admit that I am a little
> lost when it comes to frames, divs, and spans.  I am looking for the
> best strategy to find elements in an applications.  In IE Developers
> tool bar, I can readily find the link I would like to click, but using
> WATIR 1.6.2 I am having trouble getting to this object.  Here is what
> IE Dev Toolbar shows as the structure.
>
> HTML
>  Head
>     Frame set id = x
>         Frame id = x1
>         Frame id = x2
>         Frame id = x3
>            #document
>                HTML
>                   HEAD
>                     Body
>                        Table
>                           TBody
>                              TR
>                                TD
>                                  DIV
>                                  DIV
>                                     Div id = mPFlag
>                                        Table class = topSubMenuBar
>                                           TBody
>                                              TR
>                                                 TD
>                                                    Span
>                                                          #Text
>
> I need to click the link represented by #Text.  I used the show frames
> method to make sure I can see all frames using Watir 1.6.2.  Here is
> the strategy I was attempting to use to isolate this object.
>
>          @ie.show_frames
>          @ie.show_all_objects
>          @ie.show_tables
>          @ie.frame("sectionFrame").show_frames
>          @ie.frame("sectionFrame").show_tables
>          @ie.frame("sectionFrame").show_all_objects
>          @ie.frame("sectionFrame").frame("mainFrame").show_frames
>          @ie.frame("sectionFrame").frame
> ("mainFrame").show_all_objects
>          @ie.frame("sectionFrame").frame("mainFrame").show_tables
>
> I guess show_tables is depricated in 1.6.2, so I would welcome any
> ideas on strategy for me to isolate the text within the span structure
> above.
>
> Thanks in advance for your time and consideration.
>
> Carl
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
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