所以这段代码工作得很好,直到我最近更新了我的 selenium webdriver:
When /^I search for (.*)$/ do |term|
term = " " if term == "blank"
step "I fill in search with #{term}"
within(".navbar-search") do
page.find(:css, "li:first").click
end
end
我更新了,现在我收到以下错误:
An invalid or illegal string was specified (Selenium::WebDriver::Error::UnknownError)
./features/step_definitions/search_steps.rb:5:in `block (2 levels) in <top (required)>'
./features/step_definitions/search_steps.rb:4:in `/^I search for (.*)$/'
features/search_friend.feature:13:in `When I search for <term>'
这是黄瓜的特点:
@javascript
Scenario Outline: The search bar
Given I login
And I have a contact named ABC
And I have a contact named DEF
And I have a contact named GHI
When I search for <term>
Then I should see the message <message>
Examples:
| term | message |
| ... some examples ... | |