[rspec-users] Can't use Cucumber with Webrat and Selenium

26 views
Skip to first unread message

Enrico Listemann

unread,
Apr 5, 2009, 10:23:55 AM4/5/09
to rspec...@rubyforge.org
Hi,

I followed the instructions at
http://wiki.github.com/aslakhellesoy/cucumber/setting-up-selenium to get
Selenium and Webrat to work with Cucumber. I have no problems using
Webrat but when I switch to use Selenium, I get the following error
message when I try to access the browser(e.g. calling visit(login_path))
in a step definition.

Die angeforderte Adresse ist in diesem Kontext ungültig. - connect(2)
(Errno::EADDRNOTAVAIL)
E:/SOFTWAREENTWICKLUNG/ruby/lib/ruby/1.8/timeout.rb:56:in `timeout'
(eval):2:in `visit'

(for those who don't speak german: The requested address is invalid in
this context.)

I also tried to use Cucumber and Selenium without Webrat and it works
without any problems.

I'm using Rails 2.3.0, Cucumber 0.2.3, Webrat 0.4.3 and RSpec 1.2.2 on a
WinXP machine.

I would be very pleased if anyone had an idea about the reason for this
failure.

Enrico
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
rspec-users mailing list
rspec...@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

JDS

unread,
May 13, 2009, 3:53:24 AM5/13/09
to rspec...@rubyforge.org
Well I can't help you but I do have a similar problem. In my case
Cucumber-Selenium works, Cucumber-Webrat works but Cucmber-Webrat-
Selenium doesn't work because Webrat issues requests to www.example.com
and Selenium starts up a mongrel on localhost:3001, connects to it via
Firefox and then throws up when it gets a request to go to www.example.com.
I need to find a way to change the host name that Webrat uses when it
connects via Selenium.

On 5 Apr, 15:23, Enrico Listemann <li...@ruby-forum.com> wrote:
> Hi,
>

> I followed the instructions athttp://wiki.github.com/aslakhellesoy/cucumber/setting-up-seleniumto getSeleniumandWebratto work with Cucumber. I have no problems usingWebratbut when I switch to useSelenium, I get the following error


> message when I try to access the browser(e.g. calling visit(login_path))
> in a step definition.
>
> Die angeforderte Adresse ist in diesem Kontext ungültig. - connect(2)
> (Errno::EADDRNOTAVAIL)
> E:/SOFTWAREENTWICKLUNG/ruby/lib/ruby/1.8/timeout.rb:56:in `timeout'
> (eval):2:in `visit'
>
> (for those who don't speak german: The requested address is invalid in
> this context.)
>

> I also tried to use Cucumber andSeleniumwithoutWebratand it works
> without any problems.
>
> I'm using Rails 2.3.0, Cucumber 0.2.3,Webrat0.4.3 and RSpec 1.2.2 on a


> WinXP machine.
>
> I would be very pleased if anyone had an idea about the reason for this
> failure.
>
> Enrico
> --

> Posted viahttp://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-us...@rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users

Auto Bot

unread,
Jun 18, 2009, 9:51:57 PM6/18/09
to rspec...@rubyforge.org
John Small wrote:
> Well I can't help you but I do have a similar problem. In my case
> Cucumber-Selenium works, Cucumber-Webrat works but Cucmber-Webrat-
> Selenium doesn't work because Webrat issues requests to www.example.com
> and Selenium starts up a mongrel on localhost:3001, connects to it via
> Firefox and then throws up when it gets a request to go to
> www.example.com.
> I need to find a way to change the host name that Webrat uses when it
> connects via Selenium.

In env.rb

Webrat.configure do |config|
config.mode = :selenium
config.application_environment = :test

# Tell where the application is running on for selenium to test
config.application_address = "#{app_server_host}"
config.application_port = "#{app_port}"

# Tell where selenium server is running on, when not specified defaults
to nil (server starts in webrat process and runs locally)
config.selenium_server_address = "#{selenium_server_host}"
config.selenium_server_port = "4444"

# Set the key that Selenium uses to determine the browser running
config.selenium_browser_key = '#{browser}'

end
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
rspec-users mailing list
rspec...@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Yi Wen

unread,
Jun 19, 2009, 10:24:53 AM6/19/09
to rspec...@rubyforge.org
Hello,

I has spork 0.5.0 and worked fine. now I updated to spork 0.5.7 which
seems to break the existing setting. The stack trace looks like this:

Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
uninitialized constant MissingSourceFile (NameError)
/my_proj/vendor/gems/rspec-rails-1.2.6/lib/spec/rails.rb:5
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
`gem_original_require'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
`require'
/my_porj/spec/spec_helper.rb:8
/usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/
spork.rb:11:in `prefork'
/my_porj/spec/spec_helper.rb:4
/usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/
spork/server.rb:166:in `load'
/usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/
spork/server.rb:166:in `preload'
/usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/
spork/app_framework/rails.rb:121:in `preload'
/usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/
spork/server.rb:162:in `preload'
/usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/
spork.rb:41:in `exec_prefork'
/usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/
spork/server.rb:148:in `preload'
/usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/
spork/runner.rb:95:in `run'
/usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/
spork/runner.rb:10:in `run'
/usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/spork:11
/usr/local/bin/spork:19:in `load'
/usr/local/bin/spork:19


It's missing application_controller. THe environment.rb is loaded
before require 'spec/rails'. Any idea?

Thanks

Yi

David Chelimsky

unread,
Jun 19, 2009, 10:34:16 AM6/19/09
to rspec-users
On Fri, Jun 19, 2009 at 9:33 AM, David Chelimsky<dchel...@gmail.com> wrote:

> On Fri, Jun 19, 2009 at 9:24 AM, Yi Wen<haya...@gmail.com> wrote:
>> Hello,
>>
>> I has spork 0.5.0 and worked fine. now I updated to spork 0.5.7 which seems
>> to break the existing setting. The stack trace looks like this:
>>
>> Using RSpec
>> Preloading Rails environment
>> Loading Spork.prefork block...
>> uninitialized constant MissingSourceFile (NameError)
>> /my_proj/vendor/gems/rspec-rails-1.2.6/lib/spec/rails.rb:5
>> /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
>> `gem_original_require'
>> /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
>> /my_porj/spec/spec_helper.rb:8
>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/spork.rb:11:in

>> `prefork'
>> /my_porj/spec/spec_helper.rb:4
>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/spork/server.rb:166:in
>> `load'
>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/spork/server.rb:166:in
>> `preload'
>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/spork/app_framework/rails.rb:121:in
>> `preload'
>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/spork/server.rb:162:in
>> `preload'
>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/spork.rb:41:in
>> `exec_prefork'
>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/spork/server.rb:148:in
>> `preload'
>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/spork/runner.rb:95:in
>> `run'
>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/spork/runner.rb:10:in

>> `run'
>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/spork:11
>> /usr/local/bin/spork:19:in `load'
>> /usr/local/bin/spork:19
>>
>>
>> It's missing application_controller. THe environment.rb is loaded before
>> require 'spec/rails'. Any idea?
>
> It's probably because of this:
> https://rspec.lighthouseapp.com/projects/5645/tickets/839
>
> If so, just remove the conditional from the line that requires environment.rb

If that's not it, you may want to try the spork google group:

http://groups.google.com/group/sporkgem

David Chelimsky

unread,
Jun 19, 2009, 10:33:42 AM6/19/09
to rspec-users
On Fri, Jun 19, 2009 at 9:24 AM, Yi Wen<haya...@gmail.com> wrote:
> Hello,
>
> I has spork 0.5.0 and worked fine. now I updated to spork 0.5.7 which seems
> to break the existing setting. The stack trace looks like this:
>
> Using RSpec
> Preloading Rails environment
> Loading Spork.prefork block...
> uninitialized constant MissingSourceFile (NameError)
> /my_proj/vendor/gems/rspec-rails-1.2.6/lib/spec/rails.rb:5
> /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
> `gem_original_require'
> /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
> /my_porj/spec/spec_helper.rb:8
> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/spork.rb:11:in
> `prefork'
> /my_porj/spec/spec_helper.rb:4

> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/spork/server.rb:166:in
> `load'
> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/spork/server.rb:166:in
> `preload'
> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/spork/app_framework/rails.rb:121:in
> `preload'
> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/spork/server.rb:162:in
> `preload'
> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/spork.rb:41:in
> `exec_prefork'
> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/spork/server.rb:148:in
> `preload'
> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/spork/runner.rb:95:in
> `run'
> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../lib/spork/runner.rb:10:in

> `run'
> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/spork:11
> /usr/local/bin/spork:19:in `load'
> /usr/local/bin/spork:19
>
>
> It's missing application_controller. THe environment.rb is loaded before
> require 'spec/rails'. Any idea?

It's probably because of this:
https://rspec.lighthouseapp.com/projects/5645/tickets/839

If so, just remove the conditional from the line that requires environment.rb

>

Yi Wen

unread,
Jun 19, 2009, 10:40:26 AM6/19/09
to rspec-users
Yup, removing the condition fixed the problem. Thanks!


On Jun 19, 2009, at 9:34 AM, David Chelimsky wrote:

> On Fri, Jun 19, 2009 at 9:33 AM, David
> Chelimsky<dchel...@gmail.com> wrote:
>> On Fri, Jun 19, 2009 at 9:24 AM, Yi Wen<haya...@gmail.com> wrote:
>>> Hello,
>>>
>>> I has spork 0.5.0 and worked fine. now I updated to spork 0.5.7
>>> which seems
>>> to break the existing setting. The stack trace looks like this:
>>>
>>> Using RSpec
>>> Preloading Rails environment
>>> Loading Spork.prefork block...
>>> uninitialized constant MissingSourceFile (NameError)
>>> /my_proj/vendor/gems/rspec-rails-1.2.6/lib/spec/rails.rb:5
>>> /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
>>> `gem_original_require'
>>> /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
>>> `require'
>>> /my_porj/spec/spec_helper.rb:8
>>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../
>>> lib/spork.rb:11:in
>>> `prefork'
>>> /my_porj/spec/spec_helper.rb:4

>>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../
>>> lib/spork/server.rb:166:in
>>> `load'
>>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../
>>> lib/spork/server.rb:166:in
>>> `preload'
>>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../
>>> lib/spork/app_framework/rails.rb:121:in
>>> `preload'
>>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../
>>> lib/spork/server.rb:162:in
>>> `preload'
>>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../
>>> lib/spork.rb:41:in
>>> `exec_prefork'
>>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../
>>> lib/spork/server.rb:148:in
>>> `preload'
>>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../
>>> lib/spork/runner.rb:95:in
>>> `run'
>>> /usr/local/lib/ruby/gems/1.8/gems/timcharper-spork-0.5.7/bin/../

Reply all
Reply to author
Forward
0 new messages