Forum: Ruby selenium with ruby rails and webrat

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Tamil R. (Guest)
on 2009-05-27 19:00
Attachment: cucumber-test-pro.zip (0 Bytes)
Hi,
I have set up selenium and webrat with cucumber and ruby rails in Cygwin
on Windows DOS machine. I have everything working expect that when I
'rake' features, selenium is not starting up any firefox browser.

I have attached my sample project for the same. When I do 'rake
features' I get the below error. It looks like the script itself is
getting executed and not being validated by selenium.

Unfortunately, I am not a ruby developer and naive wrt selenium.

==========================================================================
$ rake features
(in /cygdrive/c/work/comcast/workspace/cucumber-test-pro)
/usr/bin/ruby.exe -I
"/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.7/lib:lib" -S rcov --rails
--exclude osx\/
"/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.7/bin/cucumber" -- --format
pretty features/google_search.featu
Feature: When I am on google page, i should be
able to search any string

  Scenario: Search a string in google           #
features/google_search.feature:4
==> Waiting for Selenium RC server on port 4444... Ready!
Starting app server
    Given I am on google page                   #
features/step_definitions/google_search_steps.rb:13
      Connection refused - connect(2) (Errno::ECONNREFUSED)
      /usr/lib/ruby/1.8/net/http.rb:560:in `initialize'
      /usr/lib/ruby/1.8/net/http.rb:560:in `open'
      /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
      /usr/lib/ruby/1.8/timeout.rb:62:in `timeout'
      /usr/lib/ruby/1.8/timeout.rb:93:in `timeout'
      /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
      /usr/lib/ruby/1.8/net/http.rb:553:in `do_start'
      /usr/lib/ruby/1.8/net/http.rb:542:in `start'
      /usr/lib/ruby/1.8/net/http.rb:1035:in `request'
      /usr/lib/ruby/1.8/net/http.rb:845:in `post'
      /usr/lib/ruby/1.8/timeout.rb:62:in `timeout'
      /usr/lib/ruby/1.8/timeout.rb:93:in `timeout'
      (eval):2:in `visit'
      ./features/step_definitions/google_search_steps.rb:2:in `/^I am on
google page$/'
      features/google_search.feature:5:in `Given I am on google page'
    Then I should be able to search some string #
features/step_definitions/google_search_steps.rb:17

1 scenario (1 failed)
2 steps (1 failed, 1 skipped)
76.6%   2 file(s)   69 Lines   47 LOC
rake aborted!
Command failed with status (1): [/usr/bin/ruby.exe -I
"/usr/lib/ruby/gems/1...]

(See full trace by running task with --trace)
===============================================================================
Tamil R. (Guest)
on 2009-05-27 19:51
Hurry, I got this solved. One of my colleague pointed out this forum
which solved my issue.

I modified webrat gem source code to fix this. However, I didnot try
webrat config option. I wanted to play with working selenium for some
time.

Forum :::::
http://formatinternet.wordpress.com/2009/04/27/cuc...

THanks!

Tamil R. wrote:
> Hi,
> I have set up selenium and webrat with cucumber and ruby rails in Cygwin
> on Windows DOS machine. I have everything working expect that when I
> 'rake' features, selenium is not starting up any firefox browser.
>
> I have attached my sample project for the same. When I do 'rake
> features' I get the below error. It looks like the script itself is
> getting executed and not being validated by selenium.
>
> Unfortunately, I am not a ruby developer and naive wrt selenium.
>
> ==========================================================================
> $ rake features
> (in /cygdrive/c/work/comcast/workspace/cucumber-test-pro)
> /usr/bin/ruby.exe -I
> "/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.7/lib:lib" -S rcov --rails
> --exclude osx\/
> "/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.7/bin/cucumber" -- --format
> pretty features/google_search.featu
> Feature: When I am on google page, i should be
> able to search any string
>
>   Scenario: Search a string in google           #
> features/google_search.feature:4
> ==> Waiting for Selenium RC server on port 4444... Ready!
> Starting app server
>     Given I am on google page                   #
> features/step_definitions/google_search_steps.rb:13
>       Connection refused - connect(2) (Errno::ECONNREFUSED)
>       /usr/lib/ruby/1.8/net/http.rb:560:in `initialize'
>       /usr/lib/ruby/1.8/net/http.rb:560:in `open'
>       /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
>       /usr/lib/ruby/1.8/timeout.rb:62:in `timeout'
>       /usr/lib/ruby/1.8/timeout.rb:93:in `timeout'
>       /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
>       /usr/lib/ruby/1.8/net/http.rb:553:in `do_start'
>       /usr/lib/ruby/1.8/net/http.rb:542:in `start'
>       /usr/lib/ruby/1.8/net/http.rb:1035:in `request'
>       /usr/lib/ruby/1.8/net/http.rb:845:in `post'
>       /usr/lib/ruby/1.8/timeout.rb:62:in `timeout'
>       /usr/lib/ruby/1.8/timeout.rb:93:in `timeout'
>       (eval):2:in `visit'
>       ./features/step_definitions/google_search_steps.rb:2:in `/^I am on
> google page$/'
>       features/google_search.feature:5:in `Given I am on google page'
>     Then I should be able to search some string #
> features/step_definitions/google_search_steps.rb:17
>
> 1 scenario (1 failed)
> 2 steps (1 failed, 1 skipped)
> 76.6%   2 file(s)   69 Lines   47 LOC
> rake aborted!
> Command failed with status (1): [/usr/bin/ruby.exe -I
> "/usr/lib/ruby/gems/1...]
>
> (See full trace by running task with --trace)
> ===============================================================================
This topic is locked and can not be replied to.