array of values from page-object elements

59 Views Asked by At

is there a better way to get an array of the elements values than the following

    descriptions = []
     page.file_descriptions_elements.each do |row|
       descriptions.push(row.value)
     end 
1

There are 1 best solutions below

0
Justin Ko On BEST ANSWER

You could use Enumerable#map to reduce the code:

page.file_descriptions_elements.map(&:value)