Capybara的Selenium驱动程序将不会单击Jquery Mobile按钮

|| Capybara \的Selenium驱动程序不会单击JQuery Mobile格式的按钮。它认为该按钮不可见。 有人看到这个问题并解决了吗? 我创建了一个“ greenfield”应用程序,在此演示了此问题: https://github.com/jevy/JQuery_Mobile_Capybara
@javascript
Scenario: Clicking a button doesn\'t complain # features/click_jq_mobile_button.feature:7
  Given I am on the home page                # features/step_definitions/web_steps.rb:44
  Given I press \"Some Button\"                # features/step_definitions/web_steps.rb:52
    Element is not currently visible and so may not be interacted with (Selenium::WebDriver::Error::ElementNotDisplayedError)
    [remote server] resource://fxdriver/modules/atoms.js:9442:in `unknown\'
    [remote server] file:///var/folders/fG/fGiEX6gLHQyvWGWb-5MpfU+++TI/-Tmp-/webdriver-profile20110525-21904-h3s00b/extensions/fxdriver@googlecode.com/components/nsCommandProcessor.js:256:in `unknown\'
    [remote server] file:///var/folders/fG/fGiEX6gLHQyvWGWb-5MpfU+++TI/-Tmp-/webdriver-profile20110525-21904-h3s00b/extensions/fxdriver@googlecode.com/components/nsCommandProcessor.js:305:in `unknown\'
    [remote server] file:///var/folders/fG/fGiEX6gLHQyvWGWb-5MpfU+++TI/-Tmp-/webdriver-profile20110525-21904-h3s00b/extensions/fxdriver@googlecode.com/components/nsCommandProcessor.js:320:in `unknown\'
    [remote server] file:///var/folders/fG/fGiEX6gLHQyvWGWb-5MpfU+++TI/-Tmp-/webdriver-profile20110525-21904-h3s00b/extensions/fxdriver@googlecode.com/components/nsCommandProcessor.js:197:in `unknown\'
    (eval):2:in `send\'
    (eval):2:in `click_button\'
    ./features/step_definitions/web_steps.rb:53:in `/^(?:|I )press \"([^\"]*)\"$/\'
    features/click_jq_mobile_button.feature:9:in `Given I press \"Some Button\"\'

Failing Scenarios:
cucumber features/click_jq_mobile_button.feature:7 # Scenario: Clicking a button doesn\'t complain
    
已邀请:
如何尝试:
driver.ExecuteScript(\"$(\'#buttonName\').click()\");
这将与Selenium 2和jQuery mobile一起使用。     
Capybara的DOM轮询可能是在页面加载且处于非活动状态时找到您的选择器(在jQueryMobile页面过渡效果完成之前)。我通过如下选择范围来解决此问题:
before do
  click_link \"get_ajax_page\"
  should have_selector(\".ui-page-active #my_id\")
  click_link \"link_on_ajax_page\"
end
have_selector
将阻止脚本,直到该页面处于活动状态。     
这听起来很熟悉,但我认为我们可以通过将Selenium移到capybara-webkit来解决: http://robots.thoughtbot.com/post/4583605733/capybara-webkit     

要回复问题请先登录注册