How can we get all element values, when more than element hold same class name.
Eg: Consider I'm having n number of elements that having same class name as follows
<span class="country-name">Country 1</span>
<span class="country-name">Country 2</span>
<span class="country-name">Country 3</span>
<span class="country-name">Country 4</span>
<span class="country-name">Country 5</span>
How can I get all the element values that having the class name as country_name.
Also I have tried as follows:
span(:country, :class => 'country-name')
puts country
When I execute it, It only printing the first value (Country 1) other values are not printed. How can I get all values?
Any suggestions?