In page object I would like to have access to multiple divs in a particular way.
This is access to the first div that matches:
div(:search_result, id: /rptSearchResults/)
This would be access to multiple divs that match if divs existed in PageObject::Accessors:
divs(:search_result, id: /rptSearchResults/)
So far I have tried:
visit_page SearchResultsPage do |page|
#This outputs the first div that matches
page.search_result_element.div_elements(id: /rptSearchResults/).each { |i| puts i.text }
#This accesses the page and outputs text in all divs that match
page.div_elements(id: /rptSearchResults/).each { |i| puts i.text}
end
Can anyone suggest a better way of doing this within page-object?
Thanks in advance...