Last Updated: February 25, 2016
·
639
· adimasuhid

Capybara/Selenium Cannot See a Given CSS

Recently, Capybara with Selenium driver was not able to see a given css element. Trying without the driver works though.

As it turns out, in my case, the css element was hidden. And Capybara by default cannot see hidden elements.

There are two ways to go around this:

a. Set Capybara global options to view hidden elements

Capybara.ignore_hidden_elements

b. Set particular DSL option to see hidden elements

select "hello", from: "Some question", visible: false