
response is nil in selenium mode
Reported by Jeff Dean | February 11th, 2009 @ 10:35 PM
When running cucumber with selenium, response is always nil for me. My current setup is:
Gems
- webrat (0.4.1)
- cucumber (0.1.16)
- selenium-client (1.2.10)
- rspec (1.1.12)
- rspec-rails (1.1.12)
- nokogiri (1.1.1)
env.rb
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'cucumber/rails/world'
require 'cucumber/formatters/unicode' # Comment out this line if you don't want Cucumber Unicode support
require 'webrat'
require 'webrat/rails'
require 'cucumber/rails/rspec'
require 'webrat/rspec-rails'
require 'webrat/core/matchers'
require 'fixjour'
require 'faker'
require File.join(RAILS_ROOT, "spec", "object_creation_methods")
Dir["spec/spec_helpers/**/*.rb"].each do |file|
require_dependency file # just a table truncation script
end
include Fixjour
include TruncateTables
selenium.rb
require "webrat/selenium"
Webrat.configure do |config|
config.mode = :selenium
end
Before do
truncate_tables!
end
Executing with
cucumber -r features/support/env.rb -r features/support/selenium.rb -r features/step_definitions features/people.feature
When I run the command above, the browser opens, the "visit" steps work, clicking links works and all other action steps work, but response is nil. The error I get is:
Error Message
Then I should see "Please enter a search term and try again."
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.body (NoMethodError)
./features/step_definitions/webrat_steps.rb:90:in `Then /^I should see "(.*)"$/'
When I run it in rails integration mode, the story passes. This worked a few days ago, and I must have upgraded some gem, or changed something in my environment but I can't figure out what. What version of selenium-rc is webrat selenium tested against?
Comments and changes to this ticket
-
gaffo May 7th, 2009 @ 03:17 PM
- Tag set to stale, verify
- State changed from new to open
Jeff, It's been a while so I'm just checking if this is still an issue. Please let us know.
-
gaffo May 7th, 2009 @ 03:18 PM
- Tag changed from stale, verify to selenium, stale, verify
-
gaffo June 3rd, 2009 @ 10:36 AM
- State changed from open to out-of-date
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Ruby Acceptance Testing for Web applications.