|
本帖最后由 EricLU 于 2012-7-26 16:43 编辑
点击百度页面的“知道”链接时失败,报错如下:
no link with title, id or text '知道' found (Capybara::ElementNotFound)
(eval):2:in `click_link'
脚本是这样子的:编码:UTF-8
evn.rb文件
begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end
require 'cucumber/formatter/unicode'
require 'capybara'
require 'capybara/cucumber'
require 'capybara/dsl'
Capybara.default_driver = :selenium
Step_Definition.rb文件
Given /^I am click "(.*?)"$/ do |zhidao_link|
click_link(zhidao_link)
end
以上脚本在百度首页可以打开“MP3”,如:click_link("MP3"),
但打不开click_link("知道") |
|