ruby on rails - Capybara + Poltergeist + Phantomjs. Unable to click a button -


i have button, upon clicking change display of div none block. wanted click on button, have div displayed 'block', click "done" , div's display become 'none'. capybara able click on 1st button couldn't seem find 2nd button "done". tried several ways:

click_on("done") find_button("done").trigger('click') find_button("done").trigger('click') find_link("done").trigger('click') 

i tried use javascript:

page.execute_script("document.getelementbyid('button_done').click()") 

but nothing happens. printed out display property of pop-up div prior clicking "done" , after clicking check if button click both statements gave me div's property 'block' (expected 'block' before clicking "done" , changed "none" after clicking). allowed sleep(10) doesn't seem help.

i used same javascript on page console , worked should be.

any inputs?

thanks

edit:

feature:

given click on "create item" , chose option should able create item 

steps:

step "i chose option"   within ('#web')     click_on "on"   end   sleep 3   #here div gets displayed 'done' button   find('#button_done').click #(doesn't work though)   sleep 3   click('create') end 

try find('selector', :visible=>false)


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -