Challenge - 5 Problems
Docker Grid Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of Selenium Grid Node Registration Log
You start a Selenium Grid node using Docker with the command:
What will be the expected output in the node's Docker logs indicating successful registration?
docker run -d --net=host -e SE_EVENT_BUS_HOST=localhost -e SE_EVENT_BUS_PUBLISH_PORT=4442 -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium/node-chrome:latest
What will be the expected output in the node's Docker logs indicating successful registration?
Attempts:
2 left
💡 Hint
Look for logs that confirm successful connection to the hub.
✗ Incorrect
When a Selenium Grid node starts correctly with proper event bus environment variables, it logs an INFO message confirming registration to the hub URL.
❓ assertion
intermediate2:00remaining
Correct Assertion for Node Availability in Selenium Grid
You want to write a test to assert that a Selenium Grid node is available and ready to accept sessions. Which assertion correctly checks the node's readiness using Selenium Python bindings?
Selenium Python
from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities driver = webdriver.Remote( command_executor='http://localhost:4444/wd/hub', desired_capabilities=DesiredCapabilities.CHROME) # Which assertion below correctly verifies the node is ready?
Attempts:
2 left
💡 Hint
A valid session_id means the node accepted the session.
✗ Incorrect
If the driver.session_id is not None, it means the remote node accepted the session and is ready.
🔧 Debug
advanced2:00remaining
Debugging Selenium Grid Node Connection Failure
You run a Selenium Grid hub and a node in Docker containers on the same machine. The node fails to register with the hub. The node's Docker logs show:
What is the most likely cause?
ERROR - Could not connect to the hub at http://localhost:4444
What is the most likely cause?
Attempts:
2 left
💡 Hint
Remember how localhost behaves inside Docker containers.
✗ Incorrect
Inside a Docker container, localhost refers to the container itself, not the host machine. The node tries to connect to its own container instead of the hub.
❓ framework
advanced2:00remaining
Best Practice for Scaling Selenium Grid with Docker
You want to scale your Selenium Grid to run multiple Chrome and Firefox nodes using Docker Compose. Which approach correctly defines the services for scaling nodes?
Selenium Python
version: '3' services: selenium-hub: image: selenium/hub:latest ports: - '4444:4444' chrome: image: selenium/node-chrome:latest depends_on: - selenium-hub environment: - SE_EVENT_BUS_HOST=selenium-hub - SE_EVENT_BUS_PUBLISH_PORT=4442 - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: image: selenium/node-firefox:latest depends_on: - selenium-hub environment: - SE_EVENT_BUS_HOST=selenium-hub - SE_EVENT_BUS_PUBLISH_PORT=4442 - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
Attempts:
2 left
💡 Hint
Docker Compose version 3 supports replicas for scaling services.
✗ Incorrect
Using 'deploy: replicas: 3' under each node service in Docker Compose allows scaling multiple node containers automatically.
🧠 Conceptual
expert2:00remaining
Understanding Event Bus Ports in Selenium Grid Docker Setup
In a Docker-based Selenium Grid setup, the environment variables SE_EVENT_BUS_HOST, SE_EVENT_BUS_PUBLISH_PORT, and SE_EVENT_BUS_SUBSCRIBE_PORT are set for nodes. What is the primary purpose of these event bus ports?
Attempts:
2 left
💡 Hint
Think about how the hub and nodes coordinate in a distributed grid.
✗ Incorrect
The event bus ports allow the hub and nodes to communicate asynchronously for managing sessions and sharing node status.