views:

69

answers:

1

I have a page with HTML like this:

<a href="1">reply</a>
<a href="2">reply</a>

I need to get value of href attribute for the second link.

I can not use :text, because it will return href attribute for the first link.

browser.link(:text, "reply").href
=> "{site}1"

I can use :index, but if anything on that page changes, it could break.

browser.link(:index, 2).href
=> "{site}2"