Apzal Bahin
Apzal Bahin

Reputation: 61

How to resolve unable to connect to chromedriver 127.0.0.1 in ruby

I am using chrome driver 2.35(tried till v 2.9) and chrome browser v 65.

gems used: watir 6.10.3 selenium-webdriver 3.11.0

error message:

Selenium::WebDriver::Error::WebDriverError: unable to connect to chromedriver 127.0.0.1:9515
    from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.11.0/lib/selenium/webdriver/common/service.rb:142:in `connect_until_stable'
    from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.11.0/lib/selenium/webdriver/common/service.rb:72:in `block in start'
    from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.11.0/lib/selenium/webdriver/common/socket_lock.rb:39:in `locked'
    from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.11.0/lib/selenium/webdriver/common/service.rb:69:in `start'
    from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.11.0/lib/selenium/webdriver/chrome/driver.rb:42:in `initialize'
    from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.11.0/lib/selenium/webdriver/common/driver.rb:44:in `new'
    from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.11.0/lib/selenium/webdriver/common/driver.rb:44:in `for'
    from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.11.0/lib/selenium/webdriver.rb:85:in `for'
    from C:/Ruby23/lib/ruby/gems/2.3.0/gems/watir-6.10.3/lib/watir/browser.rb:48:in `initialize'

Upvotes: 1

Views: 2654

Answers (2)

Apzal Bahin
Apzal Bahin

Reputation: 61

I downgraded the chrome version to 62 and disabled auto update to resolve this issue. Older version available here Before installing the older version some steps needs to be followed.

  1. Uninstall current version of chrome
  2. Navigate to C:\Users\\AppData\Local and delete google directory
  3. Navigate to C:\Program Files (x86) and delete google directory
  4. Install the intended older version
  5. Don't open the chrome browser,chrome gets updated automatically.
  6. Type 'msconfig' in run command and ensure google update services are in 'stopped' status
  7. Navigate to 'C:\Program Files (x86)\Google' and rename 'update' directory to some other name.If renaming is denied ensure that all chrome related tasks are closed in task manager and then try renaming.
  8. Now open chrome and navigate to Help->About Google Chrome.If you get a error message for update then chrome won't get updated.

Upvotes: 1

Surendra Babu Gurram
Surendra Babu Gurram

Reputation: 25

I had the same issue, unable to connect chromedriver. So instead of using different chrome driver versions, I have just added gem called chromedriver-helper to my gem list, now works fine.

Upvotes: 0

Related Questions