Hi Bashir - I get the same error like Sanjay -
"No connection could be made because the target machine actively refused
it. - connect(2) (Errno::ECONNREFUSED)
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:762:in `initialize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:762:in `open'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:762:in `block in connect'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:762:in `connect'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:744:in `start'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:1284:in `request'
"
but here we do not use Watir but use a custom framework we developed ourselves.
In any case the env.rb contains the customized "After" hook as follows....
This After should trigger after scenario if it fails and not sure if that is
causing this issue
We use ruby 1.9.3p125 (2012-02-16) [i386-mingw32] and the hooks.rb does not
have @browser.close code in there like Sanjay pointed out. Can you please help?
Can you suggest a better way to do this?
#post-scenario handler
After do |scenario|
if (scenario.failed? && @test.verifyLogin())
handleFailedStep(scenario)
#Close and open browser to clean up
if (ENV['NOKILL'].eql?('TRUE'))
@test.logout()
@test.clean()
else
@test.killBrowsers()
@test.openBrowser()
end
@test.load()
@test.login()
end
end
On Friday, September 6, 2013 12:20:37 PM UTC-4, Bashir Osman wrote:
>
> Hi Sanjay,
>
> Here is a snippet of what I use. After all processes are complete it
> closes the browser
>
> before(:all) do
> @browser = Watir::Browser.new :phantomjs
> @browser.goto(Admin)
> end
> after(:all) do
> @browser.close
> end
> before(:each) do
> sleep 1
> end
>
>
> On Wednesday, 21 August 2013 04:51:12 UTC-6, 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.