Hey Jamie-
Now understand what you are looking for, I thought the text() attribute when used with the //a[contains(text(), 'foo')] would find the first occurrence of foo in an anchor tag... am I missing the boat on this one? or does this jut apply to text that gets rendered on a page and not attributes or tags?
It is good that you found a solution, but I wonder if the contains attribute (or whatever you would call it) would have helped you
<tr>
<td>click</td>
<td>//img[contains(@alt,'Edit')]</td>
<td> </td>
</tr>
Cheers-
Timur Snoke
[EMAIL PROTECTED]
[EMAIL PROTECTED] wrote on 06/28/2005 06:12:03 PM:
> Ended up working from the most general element (img) to build up the path:
>
> //[EMAIL PROTECTED]'customers']//tr[td='ZZZZ']//a//[EMAIL PROTECTED]'Edit']
>
> Works like a champ now.
>
> Jamie
>
> Jamie Orchard-Hays wrote:
> > Thanks, Howard. Tried this and haven't gotten it to work yet. I tried
> > double slasshes in front of "td" and "img", but still no go.
> >
> > I'll have to play around with it.
> >
> > Jamie
> >
> > Howard Bandy wrote:
> >
> >> Jamie Orchard-Hays wrote:
> >>
> >>> I've got a table with a dynamic number of rows. I want to find a link
> >>> (edit or delete), but I don't know the customer number coming into
> >>> the pge. (I do know the customer code, which is text in the first cell.)
> >>>
> >>> Is there any way to leverage the info on the row to reference the
> >>> links via DOM or XPath (or other) if I don't know the customer number?
> >>>
> >>> Here's what a row looks like:
> >>>
> >>> <tr class="table_row">
> >>> <td class="table_init_col">CODE</td>
> >>>
> >>> <td>Test Company</td>
> >>> <td>Test Contact</td>
> >>> <td>[EMAIL PROTECTED]</td>
> >>> <td>123-123-1234</td>
> >>> <td>
> >>> <form method="POST" id="customer79"
> >>> action=""> > vm/action/customer.CustomerManagement">
> >>>
> >>> <input type="hidden" name="customer_id" value="79"/>
> >>>
> >>> <a style="text-decoration: none;"
> >>> href=""> > ">
> >>>
> >>> <img src="" alt="Edit"
> >>> border="0">
> >>> </a>
> >>>
> >>> <a style="text-decoration: none;" href=""
> >>> > > >>> <img src=""
> >>> alt="Remove" border="0">
> >>> </a>
> >>> </form>
> >>> </td>
> >>> </tr>
> >>>
> >>> Thanks,
> >>>
> >>> Jamie
> >>> _______________________________________________
> >>> Selenium-users mailing list
> >>> [email protected]
> >>> http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users
> >>
> >>
> >>
> >> Jamie,
> >>
> >> Why, yes, there is a way (I was just dealing with this not too long
> >> ago :). Try this:
> >>
> >> | click |
> >> xpath=//[EMAIL PROTECTED]'yourTable']//tr[td='uniqueCustomerCode']
> /td//a/[EMAIL PROTECTED]'Edit']
> >> | |
> >>
> >> You may have to wait a while for this line to execute (takes almost a
> >> minute to get past it on my machine for the table I'm testing), so you
> >> may want to try and keep these kind of xpath evaluations to a
> >> minimum. Hope that fixes your problem, good luck!
> >>
> >> -Howard
> >> _______________________________________________
> >> Selenium-users mailing list
> >> [email protected]
> >> http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users
> >>
> > _______________________________________________
> > Selenium-users mailing list
> > [email protected]
> > http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users
> >
> _______________________________________________
> Selenium-users mailing list
> [email protected]
> http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users
_______________________________________________ Selenium-users mailing list [email protected] http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users
