Bird
0
0

You wrote this Docker Compose snippet for Selenium Grid but tests fail to run on Chrome nodes. What is the likely error?

medium📝 Debug Q6 of 15
Selenium Python - Selenium Grid
You wrote this Docker Compose snippet for Selenium Grid but tests fail to run on Chrome nodes. What is the likely error?
services:
  selenium-hub:
    image: selenium/hub:4.9.0-20230427
    ports:
      - 4444:4444
  chrome:
    image: selenium/node-chrome:4.9.0-20230427
    depends_on:
      - selenium-hub
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
AMissing network configuration to connect node and hub
BIncorrect image version for Chrome node
CPorts 4442 and 4443 should be exposed in node service
DHub port 4444 should be changed to 4445
Step-by-Step Solution
Solution:
  1. Step 1: Check Docker Compose networking

    Services must be on the same network to communicate; no network is defined here.
  2. Step 2: Impact of missing network

    Without shared network, node cannot reach hub at SE_EVENT_BUS_HOST, causing test failures.
  3. Final Answer:

    Missing network configuration to connect node and hub -> Option A
  4. Quick Check:

    Shared network needed for node-hub communication = A [OK]
Quick Trick: Define shared network in Docker Compose for node-hub communication [OK]
Common Mistakes:
  • Assuming ports 4442/4443 must be exposed externally
  • Changing hub port unnecessarily
  • Using wrong image version without checking network

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Python Quizzes