有一些硒功能可以在rails 2.3.4上正常工作,它们使用firefox 3.5.19进行测试。但是,在升级到rails 2.3.11之后,现在没有任何selenium功能正常工作,并且当任何功能尝试登录时它们都会超时。确切的错误如下:
==>等待端口4444上的Selenium RC服务器......准备就绪!
==>在端口3001上等待rails应用服务器......准备就绪!
Mon Aug 08 16:49:10 +0500 2011 selenium-client从selenium服务器收到故障: 请求:
cmd=waitForCondition
1= var element;
try {
element = selenium.browserbot.findElement('webrat=login');
} catch(e) {
element = null;
}
element != null;
2=5000
sessionId=676e939365d84575bb1df9d69d5583ec
received:
"Timed out after 5000ms"
called from /home/umar/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/timeout.rb:67:in `timeout'
And User logged in as 'newuser' # features/step_definitions/selenium/users_steps.rb:1
Timed out after 5000ms (Selenium::CommandError)
/home/umar/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/timeout.rb:67:in `timeout'
/home/umar/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/timeout.rb:101:in `timeout'
./vendor/plugins/webrat/lib/webrat/selenium/selenium_session.rb:46:in `fill_in'
(eval):2:in `fill_in'
./features/step_definitions/selenium/users_steps.rb:3:in `/^User logged in as '(\w+)'$/'
features/selenium/some_controller/some_feature.feature:8:in `And User logged in as 'newuser''
因此,尝试登录时出现与超时相关的错误。我该如何解决这个问题?
测试硒相关文件如下:
group :test do
gem "rspec", "1.3.0"
gem "rspec-rails", "1.3.2"
gem "rspec-expectations", "2.2.0"
gem "cucumber", "0.8.3"
gem "cucumber-rails", "~> 0.3.2"
gem "selenium-rails"
gem "rcov"
gem "webrat", "0.4.3"
gem "autotest-rails"
gem "ZenTest"
gem "headless"
end
答案 0 :(得分:1)
只是一个猜测 - 你也更新了Firefox吗?因为sefium在ff 5及更高版本中无法正常工作,输出完全相同。