I have the following code code on my page I wanna check:
...
<p class="tags-link">
<a href="/search?q=test1" rel="nofollow">test1</a>
<a href="/search?q=test2" rel="nofollow">test2</a>
<a href="/search?q=test3" rel="nofollow">test3</a>
</p>
....
<p class="tags-link">
<a href="/search?q=test4" rel="nofollow">test4</a>
<a href="/search?q=test5" rel="nofollow">test5</a>
<a href="/search?q=test6" rel="nofollow">test6</a>
</p>
....
I use Watir-webdriver and page-object. And I need to get all links related to blocks with "tags-link" class.
I have the following code:
element(:tags, :p, :css => "tags-link a")
tags_element returns the 1st link only.
The following code will give me just 3 links related to the 1st block:
element(:tags, :p, :css => "tags-link")
tags_element.element.links.each do |elm|
puts elm
end
But I need to get all tags blocks
Now I have the following code that works, but I wanna be "page-object" oriented :
@browser.elements(:css =>".tags-link a").each do |tag|
puts tag
end
Could you please help me...to get all links on the page related to "tags-link" using page-objects
Thanks, Anna