[英]step function in cucumber capybara
我嘗試從場景中獲取字符串並設置為步驟定義。 但是它不起作用。
我的情況是
Scenario: Save Contact with empty field in setting page
Given I logged in
When remove "contact" manitary field
Then I click save button
Then I should see message
我的步驟定義是
When /^remove "([^"]*)" manitary field$/ do |n|
rows = all('##{n}-mapping-table tbody tr')
rows.each do |raw|
within raw do
find('.remove_nested_fields').click
sleep 1
end
end
find("##{n}-mapping-table thead tr th.add-new .insert_in_table").click
end
錯誤消息是An invalid or illegal string was specified (Selenium::WebDriver::Error::UnknownError)
我不知道這是什么錯誤。
感謝您的意見
試試看
rows = all("##{n}-mapping-table tbody tr")
請注意雙引號:)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.