That won't ever work Basim, because per HTML standards ID values are
supposed to be unique within a page.

In this case the page has malformed HTML, it's not valid.  That's a
bug that should be filed and the page code corrected so that ID values
are not repeated within the page.   It's ok to repeat parameters such
as name or class, but ID, in order for the page to be valid HTML, MUST
be unique.

Watir presumes valid html, when selecting by ID, it returns the first
object found, no matter the element type, with that ID value.

You cannot combine ID with other values (because you should never NEED
to do that) like Index

Have the developers fix the page so the HTML is no longer invalid, or
select the elements via other identifiers as Zeljko suggests in his
responses.

On Aug 24, 7:38 pm, Basim Baassiri <[email protected]> wrote:
> I'm not sure what link you are trying to click on since I don't have any
> html to try against but something like this might work
> @browser.link(:id => "breadcrumbTable" , :index => 1).click
>
> On Tue, Aug 24, 2010 at 5:44 PM, Shlomit Gazit 
> <[email protected]>wrote:
>
>
>
> > I have in the page a table with id:
>
> >  ie.table(:id,"breadcrumbTable")
>
> > I also have two links with the same id unfortunately:
>
> > ie.link(:id,"x").click
>
> > I would like to be able to click on the link that is located *outside* of
> > the table above.
>
> > Is that clearer?
>
> > On Tue, Aug 24, 2010 at 1:44 PM, Basim Baassiri <[email protected]> wrote:
>
> >> I would like to able to help you but you haven't provided any html code
> >> that illustrates your problem nor any code that shows me that you have 
> >> tried
>
> >> assuming that you have read the examples
> >>http://wiki.openqa.org/display/WTR/Links
>
> >> you would see that
> >> <http://wiki.openqa.org/display/WTR/Links>
> >> @browser.link(:id, "breadcrumbTable").click
>
> >> might solve your problem but again I'm assuming
>
> >> On Tue, Aug 24, 2010 at 4:32 PM, Shlomit Gazit 
> >> <[email protected]>wrote:
>
> >>> I would like to be able to click on a link in the page that is not
> >>> inside a table with id = "breadcrumbTable".
>
> >>> How can I do that?
>
> >>> --
> >>> Before posting, please readhttp://watir.com/support. In short: search
> >>> before you ask, be nice.
>
> >>> You received this message because you are subscribed to
> >>>http://groups.google.com/group/watir-general
> >>> To post: [email protected]
> >>> To unsubscribe: 
> >>> [email protected]<watir-general%2bunsubscr...@goog
> >>>  legroups.com>
>
> >>  --
> >> Before posting, please readhttp://watir.com/support. In short: search
> >> before you ask, be nice.
>
> >> You received this message because you are subscribed to
> >>http://groups.google.com/group/watir-general
> >> To post: [email protected]
> >> To unsubscribe: 
> >> [email protected]<watir-general%2bunsubscr...@goog
> >>  legroups.com>
>
> >  --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > You received this message because you are subscribed to
> >http://groups.google.com/group/watir-general
> > To post: [email protected]
> > To unsubscribe: 
> > [email protected]<watir-general%2bunsubscr...@goog 
> > legroups.com>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: [email protected]
To unsubscribe: [email protected]

Reply via email to