Title: Running Webrat with Selenium
Tags: ruby-on-rails;selenium;cucumber;webrat
Question: I set up Cucumber+Webrat+Selenium according to this article.
Whenever I run my server, though, I keep getting:
ERROR Server Exception: sessionId should not be null; has this session been started yet? (Selenium75b5:f2c1:f5d7:b954:8dc3:cee9:baf:a8c0ommandError)
Two hours on Google haven't done much for me. Could you please help out? Thanks!
I am working on Ruby 1.8.7 and Rails 2.3.5 on Mac OS X 10.6.
My installed gems in test.rb are:
config.gem "database_cleaner", :lib =&gt; false, :version =&gt; "&gt;=0.5.0"
config.gem "rspec", :lib =&gt; false, :version =&gt; "&gt;=1.2.2"
config.gem "rspec-rails", :lib =&gt; false, :version =&gt; "&gt;=1.2.2"
config.gem "webrat", :lib =&gt; false, :version =&gt; "&gt;=0.4.4"
config.gem "cucumber", :lib =&gt; false, :version =&gt; "&gt;=0.3.0"
config.gem "thoughtbot-factory_girl", :lib =&gt; "factory_girl", :source =&gt; "http://gems.github.com"
config.gem "pickle", :lib =&gt; false, :version =&gt; "&gt;= 0.1.21"
Thank you very much!

Here is the accepted answer: add this line in your testing environment file in config/environments folder for example: cucumber.rb or test.rb
Here is the setting:
config.action_controller.session = { :session_http_only => false }
This should fix the issue


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 2.5', 'CreationDate': '2010:00:03/16/10', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<ruby-on-rails><selenium><cucumber><webrat>', 'Title': 'Running Webrat with Selenium', 'ViewCount': 490, 'id': 2458023, 'user_AboutMe': '', 'user_AccountId': 40758.0, 'user_DisplayName': 'Yuval Karmi', 'user_Reputation': 25799.0, 'user_Views': 1302.0, 'user_id': 118175.0}}