In the application I'm testing, some elements are hidden initially. They will be displayed via CSS when hovering over a single element:
.thread_options{ display: none; } .btn_thread_options:hover .thread_options{ display: inline; }
Hovering over the .btn_thread_options element displays some links that I want to click on Capybara. Trying to click them without any action using click_link "Send Response" gives me an error:
Failure/Error: click_link("Send Response") Selenium::WebDriver::Error::ElementNotVisibleError: Element is not currently visible and so may not be interacted with
Trying to use other ways to click on it, for example
page.execute_script("$('.btn_thread_options').trigger('mouseover')")
Doesn't work (same result).
Do not click an element first to try to make it shove:
page.find(".btn_thread_options").click
Is there a way to make this work correctly?
source share