I use capybara to test my rails application to test integration. There are many Lightbox and Ajax and js calls in my application.
@javascript Scenario: I agree functionatilty Given I go to the create account page When I click on button which is given as image "lnkTerms2" And I follow "i_agree" Then I go to the create account page
Here, in the lnkTerms2 code above, there is an id that will help open the lightbox when calling the js function. And I get an error like
Element is not currently visible and so may not be interacted with (Selenium::WebDriver::Error::ElementNotDisplayedError) [remote server] resource://fxdriver/modules/atoms.js:9519:in `unknown' [remote server] file:///tmp/webdriver-profile20111117-6876-18cfcfp/extensions/ fxdriver@googlecode.com /components/nsCommandProcessor.js:256:in `unknown' [remote server] file:///tmp/webdriver-profile20111117-6876-18cfcfp/extensions/ fxdriver@googlecode.com /components/nsCommandProcessor.js:305:in `unknown' [remote server] file:///tmp/webdriver-profile20111117-6876-18cfcfp/extensions/ fxdriver@googlecode.com /components/nsCommandProcessor.js:320:in `unknown' [remote server] file:///tmp/webdriver-profile20111117-6876-18cfcfp/extensions/ fxdriver@googlecode.com /components/nsCommandProcessor.js:197:in `unknown' (eval):2:in `send' (eval):2:in `click_link' ./features/step_definitions/web_steps.rb:300:in `/^I click on button which is given as image "([^"]*)"$/' features/Sign_up_process.feature:61:in `When I click on button which is given as image "lnkTerms2"'
The problem is that this function is called in webdriver, it does not manage to load javascript and ajax calls. And the lightbox does not open. So please offer me some solution.
Also if I write a line
When I click on button which is given as image "lnkTerms2"
after 4-5 instructions, then it works fine as it gets time to load js.
source share