I’m trying to run a test suite that will handle the jQuery lightbox. Lightbox contains a textarea and a submit button. Before lightbox appears both of these fields are hidden.
But Selenium doesn’t understand the visibility of these element in lightbox. It just shows following error.
And I fill comment box with "Text !!" # features/step_definitions/web_steps.rb:333
Element is not currently visible and so may not be interacted with (Selenium::WebDriver::Error::ElementNotVisibleError)
[remote server] file:///tmp/webdriver-profile20120403-6182-1rd9z23/extensions/fxdriver@googlecode.com/components/command_processor.js:9509:in `unknown'
[remote server] file:///tmp/webdriver-profile20120403-6182-1rd9z23/extensions/fxdriver@googlecode.com/components/command_processor.js:10510:in `unknown'
[remote server] file:///tmp/webdriver-profile20120403-6182-1rd9z23/extensions/fxdriver@googlecode.com/components/command_processor.js:10529:in `unknown'
[remote server] file:///tmp/webdriver-profile20120403-6182-1rd9z23/extensions/fxdriver@googlecode.com/components/command_processor.js:10534:in `unknown'
[remote server] file:///tmp/webdriver-profile20120403-6182-1rd9z23/extensions/fxdriver@googlecode.com/components/command_processor.js:10482:in `unknown'
(eval):2:in `send'
(eval):2:in `fill_in'
./features/step_definitions/web_steps.rb:335:in `/^I fill comment box with "([^"]*)"$/'
features/courses_flow.feature:21:in `And I fill comment box with "Text !!"'
As a temporary workaround you can allow capybara see hidden elements. I suggest use it with caution and add a special tag and enable it only for certain scenarios: