Hi guys, I got this issue resolved. The issue was I have hooks.rb which has require 'watir-webdriver' Before do @browser = Watir::Browser.new :firefox end After do @browser.close end I have the same lines of code in env.rb as well. For that reason The After block in hooks.rb is getting executed first which is closing the browser. When the After block in env.rb is executed the @browser instance variable is no longer to communicate with the browser. Now I removed the code in hooks.rb and I am able to run all my scripts without any error.
Thanks for Cheezy for pointing me in right direction. Cheers, Sanjay On Wednesday, 21 August 2013 11:51:12 UTC+1, Sanjay Hiremath wrote: > > Hi Guys, > > I have been getting this error recently. It was not the case earlier. I > can't figure out what is going on. Can you please help me resolve the > issue. I have copied the error message I am getting when I run my cucumber > test on command prompt. > > Please let me know if you need more info. > > Many Thanks, > Sanjay > > No connection could be made because the target machine actively > refused it. - connect(2) (Errno::ECONNREFUSED) > C:/Ruby193/lib/ruby/1.9.1/net/http.rb:763:in `initialize' > C:/Ruby193/lib/ruby/1.9.1/net/http.rb:763:in `open' > C:/Ruby193/lib/ruby/1.9.1/net/http.rb:763:in `block in connect' > C:/Ruby193/lib/ruby/1.9.1/timeout.rb:55:in `timeout' > C:/Ruby193/lib/ruby/1.9.1/timeout.rb:100:in `timeout' > C:/Ruby193/lib/ruby/1.9.1/net/http.rb:763:in `connect' > C:/Ruby193/lib/ruby/1.9.1/net/http.rb:756:in `do_start' > C:/Ruby193/lib/ruby/1.9.1/net/http.rb:745:in `start' > C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1285:in `request' > > C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/default.rb:83:in > `response_for' > > C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/default.rb:39:in > `request' > > C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/common.rb:40:in > `call' > > C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/bridge.rb:629:in > > `raw > _execute' > > C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/bridge.rb:607:in > > `exe > cute' > > C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/bridge.rb:356:in > > `del > eteAllCookies' > > C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/common/options.rb:67:in > > `del > ete_all_cookies' > > C:/WorkingDirectory/AvivaHousehold/stories/features/support/env.rb:34:in > `After' > > Failing Scenarios: > cucumber features\payment_page.feature:68 > > -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected] --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
