karma-webdriver-launcher icon indicating copy to clipboard operation
karma-webdriver-launcher copied to clipboard

Not working with the docker image selenium/standalone-chrome:3.9 or newer

Open michaelzangl opened this issue 4 years ago • 3 comments

When using this driver to connect to selenium/standalone-chrome:3.9 or newer, one gets a confusing error message:

09 09 2020 13:25:20.208:DEBUG [WebDriver]: WebDriver config: {"remoteHost":true,"hostname":"localhost","port":4444}
09 09 2020 13:25:20.209:DEBUG [WebDriver]: Browser capabilities: {"platform":"ANY","testName":"Karma test","tags":[],"version":"","base":"WebDriver","browserName":"chrome"}
09 09 2020 13:25:21.558:DEBUG [WebDriver]: Session ID: undefined
09 09 2020 13:25:21.588:ERROR [WebDriver]: WebDriver command failed { spec:
   { platform: 'ANY',
     testName: 'Karma test',
     tags: [],
     version: '',
     base: 'WebDriver',
     browserName: 'chrome' },
  error:
   {"message":"[get(\"http://ip-of-host-running-karma-tests:9876/?id=99564073\")] Error response status: 6 Selenium error: No active session with ID url","status":6,"cause":{"sessionId":"url","value":{"error":"invalid session id","message":"No active session with ID url","stacktrace":""},"status":6}} }

Tried to use several configs, the session id is always undefined. Might be a bug somewhere in the wd dependency.

Workaround: Use the selenium/standalone-chrome:3.8 docker image.

michaelzangl avatar Sep 09 '20 14:09 michaelzangl

Could this be an issue with the docker image instead? Have you tried the debugging instructions at https://github.com/SeleniumHQ/docker-selenium#troubleshooting ?

joeyparrish avatar Sep 09 '20 16:09 joeyparrish

Hi. I suspect this is a problem with the JS library wd and how wd attempts to access the selenium hub instance. We have no problems accessing that container the normal selenium Java library. The first issue is that sessionId is null =>

I currently found no way to inspect the HTTP traffic wd sends to the selenium endpoint.

If I interpret it correclty, the issue might be around that line in wd: jsonData.value ? jsonData.value.sessionId : false; According to the specs, there should be no .value and no .status, so it falls back to the old method.

The error message is confusing, the error handling in karma-webdriver-launcher is just missing.

michaelzangl avatar Sep 10 '20 10:09 michaelzangl

I get this error in selenoid when the appropriate selenoid image (selenoid/vnc_chrome:xxx) is not pulled manually in docker.

kisdaniel avatar Jan 19 '22 11:01 kisdaniel