0

Code does not have any other error basic structure is shown ,stuck in using the basic feature of section under

class Station_Drawer < SitePrism::Section
  element :dropdown1,"dropdown css"
end

class Radio_nav < SitePrism::Section
 section :stations,Station_Drawer, "some css"
end

class Radio_Homepage < SitePrism::Page
 section :radio_nav,Radio_nav,"some css"
end

##____steps

When(/^I click on station dropdown\.$/) do
  @page.radio_nav.stations.dropdown1.click
end

Error

Unable to find css "dropdown css" (Capybara::ElementNotFound)

Eugene S
  • 6,709
  • 8
  • 57
  • 91
  • That would imply the element isn't on the page -- Without the HTML and the actual selectors being used there's not much more we can say about it – Thomas Walpole Aug 05 '16 at 18:08
  • You're either on the wrong page or the css selector is wrong. – anks Aug 05 '16 at 18:48
  • Css is present ,checked and verified,can use to have_dropdowncss it says true – user6682889 Aug 06 '16 at 04:29
  • Do you have any debugging tool in your code? If you are using ruby I suggest binding.pry or byebug. My only hunch on this (there isn't enough information to go on more) is that there is a race condition, the css is not present when you try and click. The reason it would work on the `.to have_` is that matcher uses the default capybara wait functionality. Maybe try add `@page.radio_nav.stations.wait_for_dropdown1` before your line that clicks the element. – Dono Aug 08 '16 at 08:58

0 Answers0