开发者

how to configure cucumber and selenium with rails 2.3.11 to work correctly

There are selenium features which work correctly on a rails 2.3.4 and they use firefox 3.5.19 for testing. However, after upgrade to rails 2.3.11, no selenium feature now works correctly, and they all time out when any feature tries to log in. The exact error is as follows:

==> Waiting for Selenium RC server on port 4444... Ready!

==> Waiting for rails application server on port 3001... Ready!

Mon Aug 08 16:49:10 +0500 2011 selenium-client received failure from selenium server: requested:

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''

So it is a timeout related error that comes on trying to log in. How can i fix this?

The test selenium related files are as follows:

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


Just a guess - have you updated firefox too? Because selenium doesn't work properly with ff 5 and later and the output is exactly the same.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜