0
我是新來的黃瓜和水豚,我很困惑,出現以下錯誤:水豚和黃瓜CSS定位
When I click the "Search" button # features/step_definitions/web_steps.rb:9
Unable to find button #<Capybara::Element tag="button"> (Capybara::ElementNotFound)
./features/step_definitions/web_steps.rb:11:in `/^I click the "([^"]*)" button$/'
features/search.feature:9:in `When I click the "Search" button'
在我的特點,我有:
When I click the "Search" button
我一步看起來像:
When /^I click the "([^"]*)" button$/ do |button_text|
button_text = find('#gbqfb')
click_button button_text
end
我試過'click(button_text)和click_link方法。我正在認清它可能很明顯,我沒有看到的東西。我試圖找到一個按鈕元素的CSS定位器,然後單擊該元素。我認爲正則表達式不需要改變,因爲我改變了'button_text'局部變量。或者我?