# Selenium with ruby rails and webrat

**URL:** <https://www.ruby-forum.com/t/selenium-with-ruby-rails-and-webrat/168947>\
**Category:** Ruby\
**Created:** [May 27, 2009, 5:00pm UTC](https://www.ruby-forum.com/t/selenium-with-ruby-rails-and-webrat/168947 "2009-05-27T17:00:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![linewriter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/858c86/32.png) [@linewriter](https://www.ruby-forum.com/u/linewriter)\
**Post date:** [May 27, 2009, 5:00pm UTC](https://www.ruby-forum.com/t/selenium-with-ruby-rails-and-webrat/168947/1 "2009-05-27T17:00:21Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![linewriter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/858c86/32.png) [@linewriter](https://www.ruby-forum.com/u/linewriter)\
**Post date:** [May 27, 2009, 5:51pm UTC](https://www.ruby-forum.com/t/selenium-with-ruby-rails-and-webrat/168947/2 "2009-05-27T17:51:15Z")

</div>

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

> **[Cucumber, Selenium, Webrat, and Windows](https://formatinternet.wordpress.com/2009/04/27/cucumber-selenium-webrat-and-windows/)**
>
> I spent last Saturday hacking around with some really smart people in Madrid. It’s not widely known than in Spain there’s a thriving Ruby on Rails community -my guess would be a languag…

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)
