{"record":{"id":"6c28b627aef3dc56","repo":"SeleniumHQ/selenium","slug":"not-allowed-to-specify-a-version-when-using-an-exi","errorCode":null,"errorMessage":"Not allowed to specify a version when using an existing server path","messagePattern":"Not allowed to specify a version when using an existing server path","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"py/selenium/webdriver/remote/server.py","lineNumber":67,"sourceCode":"            pin drivers with \"--driver-configuration\").\n    \"\"\"\n\n    DEFAULT_ARGS = (\"--selenium-manager\", \"true\", \"--enable-managed-downloads\", \"true\")\n\n    def __init__(\n        self,\n        host=None,\n        port=4444,\n        path=None,\n        version=None,\n        log_level=\"INFO\",\n        env=None,\n        java_path=None,\n        startup_timeout=10,\n        args=None,\n    ):\n        if path and version:\n            raise TypeError(\"Not allowed to specify a version when using an existing server path\")\n\n        self.host = host\n        self.port = port\n        self.path = path\n        self.version = version\n        self.log_level = log_level\n        self.env = env\n        self.java_path = java_path\n        self.startup_timeout = startup_timeout\n        self.args = list(args) if args is not None else list(self.DEFAULT_ARGS)\n        self.process = None\n\n    @property\n    def startup_timeout(self):\n        return self._startup_timeout\n\n    @startup_timeout.setter\n    def startup_timeout(self, timeout):","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/py/selenium/webdriver/remote/server.py#L49-L85","documentation":"Raised as TypeError by the Server constructor when both path and version are specified simultaneously. The path parameter points to an existing server .jar, making the version parameter (used to download a specific server version) contradictory and ambiguous. The constructor enforces mutual exclusivity at the top before any other field is set.","triggerScenarios":"Calling Server(path='/path/to/selenium-server.jar', version='4.20.0') triggers the TypeError. Providing both means the library cannot determine whether to use the local jar or download a specific version.","commonSituations":"Copy-pasting from examples that use version= and adding a path= override without removing version=. Config files that set both fields.","solutions":["If using a local jar, remove the version parameter: Server(path='/path/to/selenium-server.jar')","If downloading a specific version, remove the path parameter: Server(version='4.20.0')","Ensure your configuration sets only one of the two, not both"],"exampleFix":"// before\nserver = Server(path='/opt/selenium-server.jar', version='4.20.0')\n\n// after\nserver = Server(path='/opt/selenium-server.jar')","handlingStrategy":"validation","validationCode":"path = '/opt/selenium-server.jar'\nversion = '4.20.0'\nif path and version:\n    version = None  # path takes priority\nserver = Server(path=path, version=version)","typeGuard":null,"tryCatchPattern":"try:\n    server = Server(path=path, version=version)\nexcept TypeError:\n    server = Server(path=path)  # drop version when path is given","preventionTips":["Provide only one of path or version, never both","Use path when you have a local jar, version when you want a download","Clean up config files that may set both fields"],"tags":["remote","server","configuration","mutual-exclusion","type-error"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}