Read the log: connection refused to port 4444
QuizMediumAsked in: Capgemini, Google, Salesforce, Swiggy, TCS, Zupee
The suite runs with Docker Compose: a tests container and a chrome Selenium container.
compose.log
tests-1 | ============================= test session starts ==============================
tests-1 | tests/test_login.py E
tests-1 | E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=4444): Max retries exceeded with url: /session (Caused by NewConnectionError('Failed to establish a new connection: [Errno 111] Connection refused'))
tests-1 | ========================= 1 error in 0.42s =========================
Which statements are true? Choose all that apply.
- The tests connect to localhost:4444, which inside the tests container is the tests container itself; they should use http://chrome:4444
- Even with the right address, the same error can appear if the first session is requested before the Selenium container is ready, so the tests should wait for /status to report ready
- A test assertion failed
- The chrome image is too new for pytest
This question is part of Pro+
Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.