dorish
dorish

Reputation: 29

Watir-webdriver 64bit windows7 cannot open any browser with error unexpected response, code = 502, content-type = "text/html"

Env-
64bit Windows 7
ruby 1.9.2-P290
rubygems 1.8.24
Watir 4.0.2

When try to create a browser (Chrome or IE) instance, it will fail with below errors
When try to create a Firefox instance, it will open the Firefox and then close automatically with the same errors.

irb(main):001:0> require 'rubygems'  
=> true  
irb(main):002:0> require 'watir-webdriver'  
=> true  
irb(main):003:0> ie = Watir::Browser.new:chrome  
Started ChromeDriver  
port=9515  
version=23.0.1240.0  
log=C:\Users\y93529\chromedriver.log  
Selenium::WebDriver::Error::WebDriverError: unexpected response, code=502, conte
nt-type="text/html"
<HEAD><TITLE>Connection refused</TITLE></HEAD>
<BODY BGCOLOR="white" FGCOLOR="black"><H1>Connection refused</H1><HR>
<FONT FACE="Helvetica,Arial"><B>
Description: Connection refused</B></FONT>
<HR>
<!-- default "Connection refused" response (502) -->
</BODY>
    from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/remote/http/common.rb:66:in `create_response'
    from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/remote/http/default.rb:66:in `request'
    from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/remote/http/common.rb:40:in `call'
    from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/remote/bridge.rb:615:in `raw_execute'
    from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
 nium/webdriver/remote/bridge.rb:92:in `create_session'
    from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
 nium/webdriver/remote/bridge.rb:68:in `initialize'
    from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/chrome/bridge.rb:29:in `initialize'
    from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/common/driver.rb:37:in `new'
    from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/common/driver.rb:37:in `for'
    from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver.rb:67:in `for'
    from C:/ruby/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir-we
bdriver/browser.rb:46:in `initialize'
    from (irb):3:in `new'
    from (irb):3
    from C:/ruby/bin/irb:12:in `<main>'

One point to add - The same environment in 32bit windows 7, everything works good. I doubt if there is some difference of the supporting of webdriver between 64bit win7 and 32bit win7

Any advice will be highly appreciated.

Upvotes: 1

Views: 1354

Answers (1)

dorish
dorish

Reputation: 29

It was solved! My network has a proxy, when I tried to install the watir, I configured the command line with the proxy, so the command line can download and install watir. After installation, I did NOT delete the proxy that I configured, it was still in the envrionment variables. That's why it fails each time I tried to start a browser with watir-webdriver. Delete this proxy, everything works fine.

Thanks guys for your participate in solving this problem.

Upvotes: 2

Related Questions