Failed to open TCP connection to localhost:17556 (No connection could be made because the target machine actively refused it. - connect(2) for "localhost" port 17556)

Issue #14835845 • Assigned to Steven K.

Details

Author
Mark D.
Created
Nov 27, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
15.15063
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Issue
It seems like there is something wrong with the edge driver.
simple .quit commands don’t work anymore in watir/selenium where they do work perfectly i.c.w. Chrome/FF

My setup
Windows 10 (x64)
Microsoft Edge 40.15063.674.0
Microsoft EdgeHTML 15.15063
Edgedriver 15063
ruby 2.3.3 (x86)

gems list

*** LOCAL GEMS ***
appium_lib (9.6.0)
awesome_print (1.8.0)
backports (3.8.0)
bigdecimal (1.3.2, default: 1.2.8)
builder (3.2.3)
bundler (1.15.4)
childprocess (0.8.0, 0.7.1)
cucumber (2.4.0)
cucumber-core (2.0.0, 1.5.0)
cucumber-wire (0.0.1)
diff-lcs (1.3)
Eventer (1.0.0)
facets (3.1.0)
faraday (0.13.1, 0.13.0)
faraday_json (0.1.4)
faraday_middleware (0.12.2)
ffi (1.9.18 x86-mingw32)
gherkin (4.1.3)
io-console (0.4.6, default: 0.4.5)
json (2.1.0, default: 1.8.3)
lapis_lazuli (2.0.1, 2.0.0)
mini_portile2 (2.2.0)
minitest (5.10.3)
multi_json (1.12.2, 1.12.1)
multi_test (0.1.2)
multi_xml (0.6.0)
multipart-post (2.0.0)
nokogiri (1.8.0 x86-mingw32)
psych (2.2.4, default: 2.1.0)
rdoc (5.1.0, default: 4.2.1)
require_all (1.4.0)
rubyzip (1.2.1)
selenium-webdriver (3.7.0, 3.6.0)
tai64 (0.0.5)
teelogger (0.5.1)
thor (0.20.0, 0.19.4)
tomlrb (1.2.4)
watir (6.9.1)
websocket (1.2.4)

Watir + ruby bindings

irb(main):002:0> require 'watir'
=> true
irb(main):003:0> browser = Watir::Browser.new :edge
=> #<Watir::Browser:0x..fe93722ba url="about:blank" title="">
irb(main):004:0> browser.goto "http://google.com"
=> "http://google.com"
irb(main):005:0> browser.quit
Errno::ECONNREFUSED: Failed to open TCP connection to localhost:17556 (No connection could be made because the target machine actively refused it. - connect(2) for "localhost" port 17556)
        from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:882:in `rescue in block in connect'
        from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:879:in `block in connect'
        from C:/Ruby23/lib/ruby/2.3.0/timeout.rb:91:in `block in timeout'
        from C:/Ruby23/lib/ruby/2.3.0/timeout.rb:101:in `timeout'
        from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:878:in `connect'
        from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1476:in `begin_transport'
        from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1433:in `transport_request'
        from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1407:in `request'
        from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1156:in `get'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/service.rb:128:in `block in stop_server'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/service.rb:108:in `block in connect_to_server'
        from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:853:in `start'
        from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:584:in `start'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/service.rb:104:in `connect_to_server'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/service.rb:128:in `stop_server'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/service.rb:77:in `stop'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/edge/driver.rb:72:in `quit'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/watir-6.9.1/lib/watir/browser.rb:143:in `close'
        from (irb):5
        from C:/Ruby23/bin/irb.cmd:19:in `<main>'
irb(main):006:0>

Selenium + ruby bindings

irb(main):001:0> require 'selenium-webdriver'
=> true
irb(main):002:0> driver = Selenium::WebDriver.for :edge
=> #<Selenium::WebDriver::Edge::Driver:0x136c312 browser=:MicrosoftEdge>
irb(main):003:0> driver.navigate.to "http://google.com"
=> nil
irb(main):004:0> driver.title
=> "Google"
irb(main):005:0> driver.quit
Errno::ECONNREFUSED: Failed to open TCP connection to localhost:17556 (No connection could be made because the target machine actively refused it. - connect(2) for "localhost" port 17556)
        from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:882:in `rescue in block in connect'
        from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:879:in `block in connect'
        from C:/Ruby23/lib/ruby/2.3.0/timeout.rb:91:in `block in timeout'
        from C:/Ruby23/lib/ruby/2.3.0/timeout.rb:101:in `timeout'
        from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:878:in `connect'
        from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1476:in `begin_transport'
        from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1433:in `transport_request'
        from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1407:in `request'
        from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1156:in `get'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/service.rb:128:in `block in stop_server'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/service.rb:108:in `block in connect_to_server'
        from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:853:in `start'
        from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:584:in `start'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/service.rb:104:in `connect_to_server'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/service.rb:128:in `stop_server'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/service.rb:77:in `stop'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/edge/driver.rb:72:in `quit'
        from (irb):5
        from C:/Ruby23/bin/irb.cmd:19:in `<main>'
irb(main):006:0>

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Steven K.”

    • Hi Mark,

      I have noticed some timing differences (delays) with the new bindings and/or webDriver.  Do your test cases have explicit waits in them around the failing areas?  If not can you retry your testing with explicit waits?  Adding them corrected some test cases that began to fail recently.

      Let me know,

      Steve

    • Hi Steven,

      I mentioned the click in the top section, but that is covered by another ticket (but I see no option to edit my response anymore), sorry about that.
      But when I do a browser.quit or driver.quit I always see this error.
      So no timing is involved here. It just always happens when I quit the browser.
      When I use irb it’s not a test script that runs, but just me typing in commands manually.
      I do see the browser being closed down, but after that this error appears.

      Cheers,
      Mark

    • Another thing I noticed is that when I run my test suite. I have configured it so that after each feature file it will close the browser instance and start up a new one. Each last test of that feature file fails with the same error as mentioned above. Like it closes the browser to soon or something.

    • Microsoft Edge Team

      Changed Steps to Reproduce

    • I updated the ticket by removing the “.click” mention.  Let me know if I my change is not correct.

      Can you provide a simplified repro?  E.g. your test suite with just two test cases with most of the test code removed but what is essential for testing the .quit between each test case?  I want to look at the timing and how the test is setup, etc.

    • Just to be clear, the .quit used to work with the previous version of Windows 10 and the MicrosoftWebDriver.exe?  Will you provide the extended version of Windows 10 you are seeing this on?  Win + S and type ‘winver’ and press enter.

      Also, I just realized that your test cases have already been provided.  The view I have in my tool removed the <cr><lf>’s and so I thought it was all output.

      As an FYI, there has been some discussion about the usability of localhost in general.  Not sure if there was a change to the security settings that could be causing this.  I will investigate this.  Here are references for what I am referring to.  Reminder, that this is a only a guess but something to think about related to localhost usage in general.  :-)

      https://tools.ietf.org/html/draft-ietf-dnsop-let-localhost-be-localhost-01
      https://w3c.github.io/webappsec-secure-contexts/#localhost

      Thanks again and I will let you know what we find,

      Steve

    • Hi Steven,

      Thanks for your update.

      Update:

      • The update is correct

      Windows 10:

      • Win10 & 15.15063 & .quit used to work for me
      • My current version is: 1703 (OS Build 15063.726)

      Example:

      • Indeed in the description I have some small samples. If you need anything else, let me know
    • Here is a gist with logger.level = :info (in case this is useful)
      https://gist.github.com/mark0203/b9d759e737cdaddb6c95954b491a6d7b

    You need to sign in to your Microsoft account to add a comment.

    Sign in