[py] don't use websocket-port if user sets connect-existing (a4dc6e)
@@ -19,7 +19,6 @@ from typing import List
from selenium.webdriver.common import (service, utils)
-
DEFAULT_EXECUTABLE_PATH = "geckodriver"
@@ -53,6 +52,7 @@ class Service(service.Service):
self, executable_path, port=port, log_file=log_file, env=env)
self.service_args = service_args or []
# Set a port for CDP
+ if '--connect-existing' not in service_args:
self.service_args.append("--websocket-port")
self.service_args.append("%d" % utils.free_port())
# Set the webdriver port
