I have an issue when creating Default_data. When I created default data it works fine. Problem is, when I select a radio on same page and additional option drop down appears. When I want to select an item from the select_list, no item is selected from the list and the step moves
on. Next button is clicked and test is pass. Can anyone please help me out...
My script looks like this.
class PropertyDetailsPage
include PageObject
include DataMagic
DEFAULT_DATA = {
'property_type' => 'Detached House',
'year_built' => 1950,
'number_of_bedrooms' => 3,
'number_of_bathrooms' => 2,
'burglar_alarm' => 'Monitored, Audible/bells only',
'ownership' => 'Mortgaged',
'num_of_adults' => 2,
'num_of_children' => 2,
'unused_duration' => 3,
'property_let' => 'Immediate family'
}
select_list(:property_type, :id => "PropertyType")
text_field(:year_built, :id => "YearBuilt")
select_list(:number_of_bedrooms, :id => "NumberOfBedrooms")
select_list(:number_of_bathrooms, :id => "NumberOfBathrooms")
select_list(:burglar_alarm, :id => "BurglarAlarm")
select_list(:ownership, :id => "Ownership")
select_list(:num_of_adults, :id => "NumberOfAdults")
select_list(:num_of_children, :id => "NumberOfChildren")
select_list(:unused_duration, :id => "UnusedDuration")
select_list(:property_let, :id => "PropertyLetTo")
def enter_property_details(data = {})
data = DEFAULT_DATA.merge(data)
self.property_type = data['property_type']
self.year_built = data['year_built']
self.number_of_bedrooms = data['number_of_bedrooms']
self.number_of_bathrooms = data['number_of_bathrooms']
self.burglar_alarm = data['burglar_alarm']
self.ownership = data['ownership']
self.num_of_adults = data['num_of_adults']
self.num_of_children = data['num_of_children']
self.unused_duration = data['unused_duration']
self.property_let = data['property_let'] #if @browser.select_list(:id => "PropertyLetTo").present?
end
def continue_to_your_cover
@browser.button(:id => "submitPropertyDetails").click
end
def radio_property_let
@browser.radio(:id, "IsPropertyLet_Yes").click
end
end
Thanks, Sanjay