# Making the distinction between similarly titled links in Cuc

**URL:** <https://www.ruby-forum.com/t/making-the-distinction-between-similarly-titled-links-in-cuc/181612>\
**Category:** Rails\
**Created:** [January 14, 2010, 5:56pm UTC](https://www.ruby-forum.com/t/making-the-distinction-between-similarly-titled-links-in-cuc/181612 "2010-01-14T17:56:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kuramonni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ad7895/32.png) [@kuramonni](https://www.ruby-forum.com/u/kuramonni)\
**Post date:** [January 14, 2010, 5:56pm UTC](https://www.ruby-forum.com/t/making-the-distinction-between-similarly-titled-links-in-cuc/181612/1 "2010-01-14T17:56:39Z")

</div>

Hoblaa!

I’m writing a test for modifying a list structure. Say I have a list of  
objects in the view along the lines of:  
Object1 View Edit Delete  
Object2 View Edit Delete  
Object3 View Edit Delete  
Object4 View Edit Delete

I want to be able to write a test in Cucumber that’ll perform an action  
on one of the objects, i.e. Object2. How can I pinpoint the correct  
View/Edit/Delete link from the list? I can’t really use the standard

` I follow "View"
`

because it will just follow the View link for Object1 (I assume).

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![kuramonni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ad7895/32.png) [@kuramonni](https://www.ruby-forum.com/u/kuramonni)\
**Post date:** [January 15, 2010, 3:03am UTC](https://www.ruby-forum.com/t/making-the-distinction-between-similarly-titled-links-in-cuc/181612/2 "2010-01-15T03:03:52Z")

</div>

Kura Monni wrote:

> Hoblaa!
> 
> I’m writing a test for modifying a list structure. Say I have a list of  
> objects in the view along the lines of:  
> Object1 View Edit Delete  
> Object2 View Edit Delete  
> Object3 View Edit Delete  
> Object4 View Edit Delete
> 
> I want to be able to write a test in Cucumber that’ll perform an action  
> on one of the objects, i.e. Object2. How can I pinpoint the correct  
> View/Edit/Delete link from the list? I can’t really use the standard
> 
> ` I follow "View"
> `
> 
> because it will just follow the View link for Object1 (I assume).
> 
> Thanks in advance.

I’m about to try dealing with a similar problem. Webrat will match  
objects by CSS selector; I don’t know yet (because I haven’t yet tried!)  
whether Cucumber’s default webrat\_steps will work with that matching  
strategy, but if not, it shouldn’t be too hard to write new steps that  
do work.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
