Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cucumber Capybara未按名称找到提交按钮_Cucumber_Ruby On Rails 3_Capybara - Fatal编程技术网

Cucumber Capybara未按名称找到提交按钮

Cucumber Capybara未按名称找到提交按钮,cucumber,ruby-on-rails-3,capybara,Cucumber,Ruby On Rails 3,Capybara,我在尝试从webrat切换到capybara时出现了一些奇怪的情况。错误是: And I press "Create floob" # features/step_definitions/web_steps.rb:27 no button with value or id or text 'Create floob' found (Capybara::ElementNotFound) 我的应用程序中的html如下所示: <fieldset class="buttons"&

我在尝试从webrat切换到capybara时出现了一些奇怪的情况。错误是:

And I press "Create floob"
    # features/step_definitions/web_steps.rb:27
    no button with value or id or text 'Create floob' found (Capybara::ElementNotFound)
我的应用程序中的html如下所示:

<fieldset class="buttons">
  <ol>
    <input id="floob_submit" name="commit" type="submit" value="Create floob" /> 
  </ol>
</fieldset>

我本以为水豚会查看页面上按钮的
值,然后阅读文档——看起来确实如此,但它不起作用!如果我将cuke文件中的行更改为
,然后按“floob_submit”
一切正常,但我不想更改所有功能


有没有人想过为什么会发生这种情况,以及是否有解决办法?谢谢朋友们

我能看到的唯一一件事是,您没有将输入包装在
  • 中。这可能会让DOM产生足够的混乱,从而导致您的问题