Docker Community Forums

Share and learn in the Docker community.

Docker compose does not work for Selenium CSharp as expected

HI I have Selenium C# Docker Project.If I run Docker commands at commandline, then it works, but If I want todo the same with docker compose File, Then It does’nt work. Help please.

Commandline Version:
docker run -d -p 4446:4444 --name selenium-hub -P selenium/hub

docker run -d -P --link selenium-hub:hub selenium/node-chrome-debug

docker run -d -P --link selenium-hub:hub selenium/node-firefox-debug

C code with HOOKS.cs and driver Driver = new RemoteWebDriver(new Uri(“http://localhost:4446/wd/hub”), caps); //Remote

This is the compose File:

version: ‘3’
services:
seleniumhub:
image: selenium/hub
ports:
- 4444:4444
firefoxnode:
image: selenium/node-firefox-debug
ports:
- 4577
links:
- seleniumhub:hub
chromenode:
image: selenium/node-chrome-debug
ports:
- 4578
links:
- seleniumhub:hub

Here is the LOG file: I See that it starts with chromenode,then Firefoxnode and then the Selenium HUB, Then it says, | Not linked with a running Hub container

NOTE: I'm working on Windows

PS C:\Users\ahmet\source\repos\SeleniumParalelTestDocker> docker-compose logs
Attaching to seleniumparaleltestdocker_chromenode_1, seleniumparaleltestdocker_firefoxnode_1, seleniumparaleltestdocker_seleniumhub_1
chromenode_1   | 2021-02-18 08:02:33,043 INFO Included extra file "/etc/supervisor/conf.d/selenium-debug.conf" during parsing
chromenode_1   | 2021-02-18 08:02:33,044 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing
chromenode_1   | 2021-02-18 08:02:33,046 INFO supervisord started with pid 8
chromenode_1   | 2021-02-18 08:02:34,049 INFO spawned: 'xvfb' with pid 10
chromenode_1   | 2021-02-18 08:02:34,051 INFO spawned: 'fluxbox' with pid 11
chromenode_1   | 2021-02-18 08:02:34,053 INFO spawned: 'vnc' with pid 12
chromenode_1   | 2021-02-18 08:02:34,057 INFO spawned: 'selenium-node' with pid 13
chromenode_1   | 2021-02-18 08:02:34,597 INFO success: xvfb entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
chromenode_1   | 2021-02-18 08:02:34,597 INFO success: fluxbox entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
chromenode_1   | 2021-02-18 08:02:34,598 INFO success: vnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
chromenode_1   | 2021-02-18 08:02:34,599 INFO success: selenium-node entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
chromenode_1   | Not linked with a running Hub container
chromenode_1   | 2021-02-18 08:02:34,999 INFO exited: selenium-node (exit status 1; not expected)
firefoxnode_1  | 2021-02-18 08:02:33,067 INFO Included extra file "/etc/supervisor/conf.d/selenium-debug.conf" during parsing
firefoxnode_1  | 2021-02-18 08:02:33,067 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing
firefoxnode_1  | 2021-02-18 08:02:33,070 INFO supervisord started with pid 8
firefoxnode_1  | 2021-02-18 08:02:34,073 INFO spawned: 'xvfb' with pid 10
firefoxnode_1  | 2021-02-18 08:02:34,075 INFO spawned: 'fluxbox' with pid 11
firefoxnode_1  | 2021-02-18 08:02:34,077 INFO spawned: 'vnc' with pid 12
firefoxnode_1  | 2021-02-18 08:02:34,079 INFO spawned: 'selenium-node' with pid 13
firefoxnode_1  | 2021-02-18 08:02:34,598 INFO success: xvfb entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
firefoxnode_1  | 2021-02-18 08:02:34,599 INFO success: fluxbox entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
firefoxnode_1  | 2021-02-18 08:02:34,599 INFO success: vnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
firefoxnode_1  | 2021-02-18 08:02:34,599 INFO success: selenium-node entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
firefoxnode_1  | Not linked with a running Hub container
firefoxnode_1  | 2021-02-18 08:02:35,004 INFO exited: selenium-node (exit status 1; not expected)
seleniumhub_1  | 2021-02-18 08:02:32,599 INFO Included extra file "/etc/supervisor/conf.d/selenium-hub.conf" during parsing
seleniumhub_1  | 2021-02-18 08:02:32,607 INFO supervisord started with pid 8
seleniumhub_1  | 2021-02-18 08:02:33,609 INFO spawned: 'selenium-hub' with pid 10
seleniumhub_1  | Starting Selenium Hub with configuration:
seleniumhub_1  | 2021-02-18 08:02:33,620 INFO success: selenium-hub entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
seleniumhub_1  | {
seleniumhub_1  |   "host": "0.0.0.0",
seleniumhub_1  |   "port": 4444,
seleniumhub_1  |   "role": "hub",
seleniumhub_1  |   "maxSession": 5,
seleniumhub_1  |   "newSessionWaitTimeout": -1,
seleniumhub_1  |   "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
seleniumhub_1  |   "throwOnCapabilityNotPresent": true,
seleniumhub_1  |   "jettyMaxThreads": -1,
seleniumhub_1  |   "cleanUpCycle": 5000,
seleniumhub_1  |   "browserTimeout": 0,
seleniumhub_1  |   "timeout": 1800,
seleniumhub_1  |   "debug": false
seleniumhub_1  | }
seleniumhub_1  | 08:02:34.321 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
seleniumhub_1  | 08:02:34.573 INFO [GridLauncherV3.lambda$buildLaunchers$5] - Launching Selenium Grid hub on port 4444
seleniumhub_1  | 2021-02-18 08:02:35.171:INFO::main: Logging initialized @1507ms to org.seleniumhq.jetty9.util.log.StdErrLog
seleniumhub_1  | 08:02:35.417 INFO [Hub.start] - Selenium Grid hub is up and running
seleniumhub_1  | 08:02:35.419 INFO [Hub.start] - Nodes should register to http://172.29.0.2:4444/grid/register/
seleniumhub_1  | 08:02:35.420 INFO [Hub.start] - Clients should connect to http://172.29.0.2:4444/wd/hub