Nick Neuberger wrote:

Use:

clickLinkWithText(String linkText, int index)

clickLinkWithText("Delete", 2)

This will click the 2nd link with the "Delete" as the text.




Not quite. If you have dynamically generated links on a page (like I do) this is very fragile. I want something like this. If I have a page that says:


<a href="foo">A Link</a>
<a href="bar">Link</a>
<a href="foobar">Another Link</a>

I'd like something like this: clickLinkWithExactText("Link") which would click the second link only. As it is now, if I have dynamically generated links, I have to manually figure out which one comes first. If for any reason the order changes, but not the text of the link, then the test will fail. Since I mostly use jWebUnit for testing behaviour, not page structure, I find this approach to be very cumbersome.

L

HTH.

Nick




-----Original Message-----
From: Laurent Duperval [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 22, 2004 8:25 AM
To: [EMAIL PROTECTED]
Subject: [Jwebunit-users] Selecting a specific link in a table


Hi,

I have a table with many rows, where the last column is a link with the text "Delete". I want to click the "Delete" link for a specific row in the table. How do I do that? For example, if I have this table:

Entry 1 | Delete
Entry 7 | Delete
Entry 5 | Delete

How to I click the link that corresponds to entry 7?

L





------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click _______________________________________________ Jwebunit-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to