Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A “connection refused” error means a process reached an address but no service accepted the connection there. In a Docker Compose test, first determine which connection failed: the Capybara/Ruby process connecting to ChromeDriver, or the browser connecting to the application. The correct hostname and port depend on where those processes run; without the refused URL and Compose configuration, there is no single setting that fixes every case.

Identify which connection was refused

Read the complete error and record the refused hostname, port, and the process making the request. There are usually two separate links to check:

  • Test process to WebDriver: Capybara or Selenium is trying to reach ChromeDriver or a Selenium server.
  • Browser to application: Chrome has started, but cannot load the app URL used by the test.

Do not assume a ChromeDriver connection error is an application networking error. Test each link from the container that makes the request.

Choose the right address for your Compose layout

The key distinction is whether the communicating processes share a network namespace or run in separate Compose services.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
OIKWAN USB Console Cable,USB to RJ45 Console Cable for Cisco Routers/AP Router/Switch Windows, Mac, Linux(1.8m,Blue)
  • ❤Console cable❤ :6FT-USB-RS232-RJ45 console cable .It's used for debugging and configuring network equipment ❤!!Please NOTE❤ this is USB to RJ45 CONSOLE CABLE ,Not ETHERNET !!!It is 8p8c!! Look carefully of the Pin is match with your device. Before ordering , please confirm it is you need. After receiving ,please read user manual /instruction at first . Customer service always online.
  • ❤Works for console port❤this USB to rj45 console cable Replaces COM port RS232 (DB-25/DB-9) serial port perfectly, connects to any laptop/PC's USB port directly to a console port like a charm. No more RS232 Female and male adapters。32 and 64 bit operating systems are both support.except Chrome OS
  • ❤Essential tools for network engineers❤The Cisoc Console Cable It's designed for that a PC or laptop‘s USB port connect to the console port with their Cisco modem, router, firewall, switch or other Serial based Cisco device. Cisco,Juniper,NETGEAR,Ubiquity,LINKSYS,TP-Link ,huawei, H3C, HP, 3com compatibly.
  • ❤The pinout names❤Cisco usb console cable USB2.0 (1.1 compatible); CONSOLE's DTE Pinouts: RTS(1), DTR(2), TXD (3), GND(4), GND(5), RXD (6), DSR(7), CTS(8); the RJ45 pinout names is 1-CTS, 2-DSR, 3-RXD, 4-GND, 5-GND, 6-TXD, 7-DTR, 8-RTS. Cable length 1.8m/6ft, Maximum RS232 speed 500kbaud
  • ❤LIFETIME CUSTOMER SUPPORT❤beside get 1pack *6ft cisco usb to console,you also back with 180-day no reason free return and refund and 24-hour online service.
Setup Addressing rule What to verify
Test process and ChromeDriver share one container/network namespace Loopback, such as 127.0.0.1, may be correct if ChromeDriver listens on that port in the same namespace. ChromeDriver is running and listening on the configured port before the WebDriver client connects.
Test and ChromeDriver run in separate Compose services Use the ChromeDriver service name and its container port, for example http://chromedriver:9515 only if the service is actually named chromedriver and listens on port 9515. Both services share a Compose network, the service name resolves, and the listener is reachable from the test service.
Browser runs in one service and application in another Use the application service name and its container listening port, not localhost or a host-published port. The browser’s app URL uses the app’s reachable service address and port.

Docker documents that containers on a Compose network are reachable by service name, and recommends referring to services by name rather than IP because container IPs can change when containers are recreated: Networking in Compose. A published host port is for access from outside that network; service-to-service traffic normally uses the destination container port.

Check Compose network membership and reachability

  1. Check service status: run docker compose ps and confirm the test, browser/ChromeDriver, and application services are running.
  2. Inspect the network: identify the Compose network and run docker network inspect <network-name>. Verify that the calling and target services are attached to the same network.
  3. Test from the caller: use docker compose exec <calling-service> sh to enter the same container context that encounters the error. Check service-name resolution and try reaching the target’s actual container port using available utilities such as curl or nc.
  4. Compare the result with the refused URL: use the exact hostname and port in the failing client configuration. A successful host-machine request does not establish that another container can reach that address.

Docker’s guidance covers network configuration, membership, and live connectivity checks using docker network inspect and docker compose exec: Compose exec and Network inspect.

Rank #2
OIKWAN USB to RS232, USB Serial Adapter with FTDI Chipset,USB 2.0 to Male DB9 Serial Cable for Windows 11,10, 8, 7, Vista, XP, 2000, Linux and Mac OS(6ft)…
  • !!Please NOTE: this is MALE RS232 to DB9 SERIAL CABLE ,Not VGA!!!It is 9 pin, NOT 15 pin!! Look carefully of the Pin is match with your device. Before ordering , please confirm the interface gender is waht you need. After receiving ,please read user manual /instruction at first and download the Driver at first from FT232 Official website or Cisco website . Customer service always online.
  • Wide range of applications: USB to RS232 DB9 male serial adapter can work with your Windows (10 / 8.1 / 8 / 7 / Vista / XP), MAC or Linux system and other platforms. USB adapter is designed to connect to serial devices, such as serial modem with DB9, ISDN terminal adapter, digital camera, label writer, palm computer, barcode scanner, PDA, cash register, CNC, PLC controller, tax printer, POS, bar code scanner, label printer, etc
  • High quality: ftdi usb serial,the latest ftdi chip set ensures more reliable and faster operation. USB 2.0 to RS232 male DB9 console cable will support 1Mbps date transfer rate.
  • Most convenient: rs232 to usb simple installation, plug and play, COM port creation, baud rate can be changed to the required settings. USB power supply - no external power supply required.
  • Exquisite design: usb-to-serial,Gold Plated USB RS232 connector and PVC cable ensure high performance and extra durability. Powered by USB port, this USB to DB9 series RS232 adapter cable is designed to fit easily into your handbag.

Verify the listener and startup order

A valid hostname is not enough: the target process must be running and listening on the configured interface and port when the client connects. Check the target container’s logs and process state, and confirm the listener is bound to an interface reachable from the caller. If ChromeDriver starts separately, configure the WebDriver client to its actual server endpoint. Google’s standalone ChromeDriver example uses 127.0.0.1:9515 for a single-host setup; that loopback address is not automatically valid from another container. See ChromeDriver: Getting started.

Compose service startup alone does not prove that an application or WebDriver listener is ready to accept requests. If tests race startup, add a readiness check or wait strategy appropriate to the service, and inspect logs to confirm the listener became available before the test runs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
DSD TECH SH-U09C2 USB to TTL Adapter Built-in FTDI FT232RL IC for Debugging and Programming
  • FTDI FT232RL IC:Built-in original FTDI FT232RL IC. Supports 5V, 3.3V and 1.8V Logic TTL levels,You can switch Logic levels by jumper
  • Protective case: Come with a transparent protective casing, this transparent protective casing to effectively prevent static interference from the hand and prevent unintentional short circuit
  • Application:Support EEPROM, Vendor ID re-write, unbrick routers ,program ESP8266 module, interface to GPS modules, flash firmware on hard drive, update transmitter, interface to set top box and other compatible UART interface devices
  • Compatibility: This USB to TTL adapter is compatible with Windows 7, 8, 10 and various Linux OS and Mac OS
  • Customer Support: DSD TECH provides permanent technical support and 1 year product replacement service for this USB to TTL Adapter.

Make sure Capybara is using a browser when needed

Capybara’s RackTest driver does not execute JavaScript. If the test exercises browser JavaScript, use a Selenium-backed Chrome driver and configure it for the container or CI environment. RackTest remains a simpler choice for non-JavaScript Rack app tests. Changing to Selenium adds browser and WebDriver runtime configuration, so confirm that the selected driver matches what the test actually covers. See Capybara documentation.

Protect remote WebDriver access

ChromeDriver permits local connections by default. If a client in another service needs access, configure remote access only for appropriate addresses and protect ChromeDriver and Selenium ports. Do not fix an address or network error by exposing an unrestricted automation endpoint. See ChromeDriver security considerations.

Rank #4
6Ft Long Cable USB 2.0 Type-A to Type-B High Speed Cord for Audio Interface, Midi Keyboard, USB Microphone, Mixer, Speaker, Monitor, Instrument, Strobe Light System Laptop Mac PC
  • FEATURES / POWER SPECS : Extra Long 6 Feet USB 2.0 Type-A Male to Type-B Male Connection Cable / High-Speed Transfer Rates up to 480Mbps 28AWG/2C+26AWG/2C with Error-Free Performance
  • COMPATIBILITY: Ideal for connecting your Yamaha Digital Piano, Roland Music Workstation, Donner DEP 10 20 45 DDP-80 88 Key Digital Pianos, Alesis, Korg, Casio Keyboard, AKAI Professional, Arturia KeyLab MiniLab, Midiplus, Nektar Impact, Novation, M-Audio MIDI Controller, Native Drum Controller, Pioneer, Hercules DJControl Inpulse, Numark DJ Mixer, Behringer U-Phoria, PreSonus AudioBox Audio Interface, Microphone, Studio Equipment to a Laptop, Computer (Mac PC) and other devices with a USB-B port
  • Also is a good USB Type B replacement cord for devices like Printer, Scanner, Fax, Hard Drive Disk, Server, Keyboard, DAC, Development board, UPS, Digital Camera, Arduino, Silhouette Cameo Cutting Tool Machine, Blue, Brother, Canon i-SENSYS PIXMA SELPHY, CyberPower, Dell, Epson Artisan Expression Home Premium Stylus WorkForce, Fujitsu, HP Deskjet ENVY LaserJet OfficeJet PhotoSmart, IOGEAR, Lexmark, Panasonic, Snowball mic
  • SAFETY: Pwr+ cables manufactured with the highest quality materials. CE/FCC/RoHS certified.
  • WARRANTY: 30 Days Refund - 24 Months Exchange. PWR+ is WA, USA based company. We are friendly Customer Support Experts

Common failure patterns and fixes

Symptom Likely explanation Next check
Connection refused at localhost from the test container localhost points to the test container itself, not a separate ChromeDriver or application service. Use the target Compose service name and its container port, if the services share a network.
Host machine reaches a published port, but another container cannot The client may be using a host-published port or host address instead of the target’s container port. From the caller container, connect to the service name and listening container port.
Service name cannot be resolved or connection times out The services may not share a network, the target name may be wrong, or the listener may not be reachable. Inspect network membership, test DNS and connectivity from the calling service, and verify the target listener.
Connection refused at the expected service name and port The address may resolve, but no process is accepting connections at that port, or it is bound only to an inaccessible interface. Check logs, process state, listening interface, port, and startup timing in the target container.
Tests fail on JavaScript behavior despite an app endpoint working The test may be using RackTest, which does not run browser JavaScript. Use a Selenium-backed Chrome driver for tests that require JavaScript.
Remote WebDriver connection is blocked ChromeDriver’s local-connection restrictions or network security controls may be preventing access. Allow only appropriate client addresses and keep the automation ports protected.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose a same-container or separate-service design

Neither layout is universally best; choose based on how your test environment needs to run.

  • Same container/network namespace: loopback can simplify endpoint addressing. The test environment must have the browser and driver available, and resource isolation is more limited.
  • Separate Compose services: browser automation can be isolated from the test runner, but requires service-name addressing, shared networking, correct container ports, and coordination with service readiness.

Whichever layout you choose, verify the real endpoint from the calling process and apply ChromeDriver’s access controls.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
USB-CSD5 for KNX3-KAP2 servo USB Debugging Cable Data Cable Download Cable Programming Cable Dual chip Design Industrial Black 3 Meter
  • USB-CSD5 for KNX3-KAP2 servo USB debugging cable Data cable Download cable Programming cable Dual chip design Industrial Black 3 Meter

Or skip the browser setup

If your goal is to capture a website rather than test browser behavior, ScreenshotNeo provides a screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP, or PDF; see the API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and the response indicates the page verdict and billing status. Its MCP server gives AI agents tools to take screenshots, get page information, and capture PDFs. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for 1,000 free screenshots a month—no card required.

Frequently Asked Questions

Why does a refused connection not tell me whether ChromeDriver or my app is broken?

The error identifies a failed network connection, not the intended role of the endpoint. Use the refused hostname and port to determine which process made the request and which service should be listening there.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can I use a container IP address instead of a Compose service name?

Docker recommends service names because container IP addresses can change when containers are recreated. Use a service name on a shared Compose network.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.