Cucumber/Webrat: follow link by CSS class?

Posted by Joe on Stack Overflow See other posts from Stack Overflow or by Joe
Published on 2009-10-20T06:48:58Z Indexed on 2010/05/21 20:30 UTC
Read the original article Hit count: 365

Filed under:
|
|
|
|

Hello there,

is it possible to follow a link by it's class name instead of the id, text or title? Given I have (haha, cucumber insider he?) the following html code:

<div id="some_information_container">
  <a href="edit" class="edit_button">Translation here</a>
</div>
  • I do not want to match by text because I'd have to care about the translation values in my tests
  • I want to have my buttons look all the same style, so I will use the CSS class.
  • I don't want to assign a id to every single link, because some of them are perfectly identified through the container and the link class

Is there anything I missed in Cucumber/Webrat? Or do you have some advices to solve this in a better way?

Thanks for your help and best regards,

Joe

edit: I found an interesting discussion going on about this topic right here - seems to remain an open issue for now. Do you have any other solutions for this?

© Stack Overflow or respective owner

Related posts about webrat

Related posts about cucumber