Hi Wesley - No, sadly the IDs are not dependable. The problem is that they
are randomly generated (thus their charming names) and I can't know what
they'll be when I create a new object.

One thing that *might* work would be if I could select a div based on a
custom attribute on it, presumably with xpath. For reference, here's a
relevant snippet:

 <div class="typebox"
       id="TYPEBOX-0x309a453a62c80d2"
       fb__tid="/people/deceased_person"
       fb__type_guid="#9202a8c04000641f80000000042cb6f1"
       fb__type_name="Deceased Person">
    <div class="typebox-container">
      <div class="typebox-container-right">
        <div class="typebox-container-left">
          <div class="typebox-column">
            <div class="typebox-column-top"></div>
            <div class="typebox-column-title">
              <a href="/view/people/deceased_person"
class="typebox-column-title-link">Deceased Person</a>
            </div>
            <div class="typebox-column-menu menu-container">
              <div class="typebox-column-menu-title menu-title
popup-trigger">more options</div>

...Where it might be possible to say (using xpath) that I want the div where
:text => 'more options', which is within the div with a custom fb__type_name
attribute with a value of 'Deceased Person'.

Here are a couple unsuccessful attempts to solve this with xpath:
  br.div(:xpath => "//[EMAIL PROTECTED]'Deceased Person'", :text => 'more
options').click
  Watir::Exception::MissingWayOfFindingObjectException: xpath is an unknown
way of finding a <DIV> element (//[EMAIL PROTECTED]'Deceased Person')

and
  br.div(:xpath, "//[EMAIL PROTECTED]'Deceased Person").flash
  NoMethodError: undefined method `[]' for nil:NilClass

Again, any help would be greatly appreciated!

Cheers,
Jeff


On Sun, Oct 12, 2008 at 6:19 PM, wesley chen <[EMAIL PROTECTED]> wrote:

> Have you noticed that, there is an id for each div?
> on page: http://sandbox.freebase.com/view/en/jared_sparks
> There are two div ids:
> TYPEBOX-0x309a453a62c80d2
> and
> TYPEBOX-0x7301883e4c6611e6
> So, you just need pay attention to the ID, you can locate the element as
> you want.
>
> Expect it could help.
>
> Wesley.
> --:)
> Man should be hard to himself, but tolerant to others.
>
> >
>


-- 
Jeff Fry

http://testingjeff.wordpress.com
http://associationforsoftwaretesting.org

--~--~---------~--~----~------------~-------~--~----~
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