I need to iterate data through yml file until last data in the hash data. For example: Below i have a yml file which has name, city & check. Here I need to add these details by clicking on add button one by one and at last Submit the details. Can any body please suggest me a way..
yml file:
samplepage:
name: ~sequential ['first', 'second', 'third']
city: ~sequential ['Ohmaha', 'New York', 'Coloumbia']
check: ~sequential ['yes', 'no', 'yes']
method:
class SamplePage
include PageObject
include DataMagic
text_field(:sample_name, id: "name_value")
text_field(:sample_city, name: "city")
text_field(:sample_verify, name: "verify_status")
button(:add, text: "Add")
button(:submit, text: "Submit")
def enter_data
# here i need to iterate three values and add one by one
self.sample_name = name # related data
self.sample_city = city # related data
self.check = check # related data
add # added it
# at the last (after 3 values added to grid I should click submit button)
submit
end
end
To iterate over a few arrays at once, you can use zip: