Polymer / tools

Polymer Tools Monorepo
BSD 3-Clause "New" or "Revised" License
430 stars 200 forks source link

Windows 7 : "Error: Unable to connect to selenium" #3228

Closed diregraph closed 2 years ago

diregraph commented 7 years ago

I tried the suggestions and solutions that were discussed in previous similar issues to no avail. Following is the terminal output after running polymer test

step: loadPlugins
step: configure
hook: configure
Expanded local browsers: [ 'chrome', 'ie' ] into capabilities: [ { browserName: 'chrome',
    version: '61',
    chromeOptions:
     { binary: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
       args: [Array] } },
  { browserName: 'internet explorer', version: '9.0.8112.16723' } ]
configuration: { suites: [ 'test/index.html' ],
  verbose: true,
  quiet: false,
  expanded: false,
  testTimeout: 90000,
  persistent: false,
  extraScripts: [],
  clientOptions: { root: '/components/', verbose: true },
  compile: 'auto',
  activeBrowsers:
   [ { browserName: 'chrome', version: '61', chromeOptions: [Object] },
     { browserName: 'internet explorer', version: '9.0.8112.16723' } ],
  browserOptions: {},
  plugins:
   { local:
      { disabled: false,
        browsers: [Array],
        skipSeleniumInstall: true,
        seleniumArgs: [] },
     sauce: { disabled: false } },
  registerHooks: [Function: registerHooks],
  enforceJsonConf: false,
  webserver:
   { hostname: 'localhost',
     _generatedIndexContent: '<!doctype html>\n<html>\n\n<head>\n  <meta charset="utf-8">\n  <script>\n    WCT = {"root":"/components/","verbose":true};\n  </script>\n  <script>\n    window.__generatedByWct = true;\n  </script>\n  <script src="../web-component-t
ester/browser.js"></script>\n  \n  \n    <script src="../web-component-tester/data/a11ySuite.js"></script>\n  \n</head>\n\n<body>\n  <script>\n    WCT.loadSuites(["test/index.html"]);\n  </script>\n</body>\n\n</html>\n' },
  root: 'C:\\Users\\username\\Desktop\\product\\App',
  ttyOutput: true,
  _: [],
  origSuites: [ 'test/' ] }
hook: prepare
hook: prepare:selenium
Starting Selenium server for local browsers
10:58:19.654 INFO - Selenium build info: version: '3.0.1', revision: '1969d75'
10:58:19.654 INFO - Launching a standalone Selenium Server
2017-11-08 10:58:19.675:INFO::main: Logging initialized @309ms

10:58:19.727 INFO - Driver class not found: com.opera.core.systems.OperaDriver
10:58:19.728 INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped:
Unable to create new instances on this machine.
10:58:19.728 INFO - Driver class not found: com.opera.core.systems.OperaDriver
10:58:19.728 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
10:58:19.734 INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
 registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform VISTA
2017-11-08 10:58:19.772:INFO:osjs.Server:main: jetty-9.2.15.v20160210
2017-11-08 10:58:19.812:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@100fc185{/,null,AVAILABLE}

2017-11-08 10:58:19.908:INFO:osjs.ServerConnector:main: Started ServerConnector@26653222{HTTP/1.1}{0.0.0.0:63638}
2017-11-08 10:58:19.908:INFO:osjs.Server:main: Started @543ms
10:58:19.908 INFO - Selenium Server is up and running
10:58:19.654 INFO - Selenium build info: version: '3.0.1', revision: '1969d75'
10:58:19.654 INFO - Launching a standalone Selenium Server
2017-11-08 10:58:19.675:INFO::main: Logging initialized @309ms

10:58:19.727 INFO - Driver class not found: com.opera.core.systems.OperaDriver
10:58:19.728 INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped:
Unable to create new instances on this machine.
10:58:19.728 INFO - Driver class not found: com.opera.core.systems.OperaDriver
10:58:19.728 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
10:58:19.734 INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
 registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform VISTA
2017-11-08 10:58:19.772:INFO:osjs.Server:main: jetty-9.2.15.v20160210
2017-11-08 10:58:19.812:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@100fc185{/,null,AVAILABLE}

2017-11-08 10:58:19.908:INFO:osjs.ServerConnector:main: Started ServerConnector@26653222{HTTP/1.1}{0.0.0.0:63638}
2017-11-08 10:58:19.908:INFO:osjs.Server:main: Started @543ms
10:58:19.908 INFO - Selenium Server is up and running

Error: Unable to connect to selenium

error:   cli runtime exception: Error: Unable to connect to selenium
error:   Error: Unable to connect to selenium
    at Timeout.hasStarted [as _onTimeout] (C:\Users\username\AppData\Roaming\npm\node_modules\polymer-cli\node_modules\selenium-standalone\lib\check-started.js:17:10)
    at ontimeout (timers.js:469:11)
    at tryOnTimeout (timers.js:304:5)
    at Timer.listOnTimeout (timers.js:264:5)

I looked into the following issues and stackoverflow questions.

573

401

https://stackoverflow.com/questions/39989175/polymer-webcomponent-tester-wct-xvfb-unable-to-connect-to-selenium

frankbecker commented 6 years ago

I am having the same problem, and I've tried every suggestion I could find. I am running on a Mac behind a corporate firewall. I do have my proxy settings defined. I even set the proxy on /usr/local/lib/node_modules/polymer-cli/node_modules/selenium-standalone/lib/default-config.js And still nothing works!!!!!

frankbecker commented 6 years ago

I was able to run the tests after going offline. I work behind a strict firewall, and was actually on a VPN when trying to run the test. But now I ran into a whole new error. Error: {"value":{"stacktrace":"org.openqa.selenium.SessionNotCreatedException: Cannot establish new session Anyways, it would be nice to be able to run this with internet access :)

frankbecker commented 6 years ago

The answer for this bug is here https://www.polymer-project.org/2.0/docs/tools/tests#safari Thank you, but I am still not able to test when online.

frankbecker commented 6 years ago

Funny enough, now it's running while I am online :) I have no idea what just happened. By running it offline it did the trick for me :)

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically closed after being marked stale. If you're still facing this problem with the above solution, please comment and we'll reopen!