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="http://a/really/long/path/here/customer%2CListCustomers.vm/action/customer.CustomerManagement";>
<input type="hidden" name="customer_id" value="79"/>

<a style="text-decoration: none;" href="http://a/really/long/url/here/customer%2CCustomer.vm?customerid=79";> <img src="http://a/shorter/path/images/icon_edit.gif"; alt="Edit" border="0">
</a>

<a style="text-decoration: none;" href="#" onClick="submitAction('customer79','doDelete')"> <img src="http://a/shorter/path/images/icon_remove.gif"; 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

Reply via email to