By default, chromedriver binds to port 9515
>chromedriver
Starting ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}) on port 9515
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
^C
You can have it bind to a different port using --port
>chromedriver --port=9999
Starting ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}) on port 9999
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
^C
Binding to port 0 causes chromedriver to use a "random" unassigned port.
>chromedriver --port=0
Starting ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}) on port 0
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
^C
But it uselessly outputs "on port 0" instead of the port to which it was actually bound. Please have chromedriver output the port it actually uses.
Thanks,
Eric
Filed as an issue here: https://bugs.chromium.org/p/chromedriver/issues/detail?id=2880