niartseoj
niartseoj

Reputation: 112

array of values from page-object elements

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 

Upvotes: 0

Views: 62

Answers (1)

Justin Ko
Justin Ko

Reputation: 46836

You could use Enumerable#map to reduce the code:

page.file_descriptions_elements.map(&:value)

Upvotes: 1

Related Questions