All subjects

Framework & DevOps · Interview subject

Docker / Cloud Interview Questions

Containerised suites, Selenium Grid on compose and cloud device farms.

51 questions

Quick interview answer

Containerise the suite, use selenium-docker or Selenium Grid via docker-compose for local parallelism, and switch to a cloud grid (BrowserStack/LambdaTest/Sauce) by changing only the RemoteWebDriver URL and capabilities.

Detailed explanation

The image pins JDK/Maven and the framework; the grid runs as separate containers so browser versions are reproducible. docker-compose brings up hub plus dynamic nodes; CI runs the suite container on the same network. Cloud grids are configured through capabilities and a secret-based URL, so environment selection stays a config concern, never a code change. Video and logs come from the grid rather than the framework.

yaml
1services:
2 selenium-hub:
3 image: selenium/hub:4.21
4 chrome:
5 image: selenium/node-chromium:4.21
6 shm_size: 2gb
7 environment: [ SE_EVENT_BUS_HOST=selenium-hub, SE_NODE_MAX_SESSIONS=4 ]

Real-world example

Containerising the grid removed 'works on my machine' browser-version failures entirely.

Interview tip

Stress shm_size and pinned browser versions — those are the two things that bite in real containers.

Next subjectPython