Closed
Description
What happened?
I have a Docker Selenium Grid running with a Hub and several nodes. In order to implement a particular feature I need to be able to get the Docker container name (of the node container) from the web driver SessionId. I found that I can make GET request to http://localhost:4444/status to get information on the Grid status. In the response to this request I have:
"slots": [
{
"id": {
"hostId": "86d384d2-2951-4da2-89dd-c3007c6bfe94",
"id": "23c6d9c6-0536-47df-bf56-9c7dcf25bf08"
},
"lastStarted": "2024-12-12T13:26:25.102549259Z",
"session": null,
"stereotype": {
"browserName": "chrome",
"browserVersion": "127.0",
"goog:chromeOptions": {
"binary": "/usr/bin/google-chrome"
},
"platformName": "linux",
"se:containerName": "",
"se:noVncPort": 7900,
"se:vncEnabled": true
}
}
]
So the se:containerName property is not set. I am assuming this is supposed to be the Docker container name that I need.
If I do a docker ps -a
I get:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b8a55fa5232c selenium/node-firefox:4.23.0-20240727 "/opt/bin/entry_poin…" 5 minutes ago Up 5 minutes 0.0.0.0:6902->5900/tcp, [::]:6902->5900/tcp firefox-node
0d16e1fdb15b selenium/video:ffmpeg-7.0.1-20240727 "/opt/bin/entry_poin…" 5 minutes ago Up 5 minutes 9000/tcp firefox-video
175f494755d3 selenium/video:ffmpeg-7.0.1-20240727 "/opt/bin/entry_poin…" 5 minutes ago Up 5 minutes 9000/tcp edge-video
8d66fe19e894 selenium/node-edge:4.23.0-20240727 "/opt/bin/entry_poin…" 5 minutes ago Up 5 minutes 0.0.0.0:6901->5900/tcp, [::]:6901->5900/tcp edge-node
9bddaf86ce65 selenium/video:ffmpeg-7.0.1-20240727 "/opt/bin/entry_poin…" 5 minutes ago Up 5 minutes 9000/tcp chrome-video
577d72f0c4ad selenium/node-chrome:4.23.0-20240727 "/opt/bin/entry_poin…" 5 minutes ago Up 5 minutes 0.0.0.0:6900->5900/tcp, [::]:6900->5900/tcp chrome-node
677aa69f3f9b selenium/hub:4.23.0-20240727 "/opt/bin/entry_poin…" 5 minutes ago Up 5 minutes 0.0.0.0:4442-4444->4442-4444/tcp, :::4442-4444->4442-4444/tcp selenium-hub
So the container name should be 'chrome-node' as you can see.
Command used to start Selenium Grid with Docker (or Kubernetes)
N/A
Relevant log output
N/A
Operating System
Ubuntu 20.04
Docker Selenium version (image tag)
4.23.0-20240727
Selenium Grid chart version (chart version)
No response