{"record":{"id":"faabfc2e283acd6a","repo":"SeleniumHQ/selenium","slug":"missing-1-required-keyword-only-argument-options","errorCode":null,"errorMessage":"missing 1 required keyword-only argument: 'options' (instance of driver `options.Options` class)","messagePattern":"missing 1 required keyword-only argument: 'options' \\(instance of driver `options\\.Options` class\\)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"py/selenium/webdriver/remote/webdriver.py","lineNumber":261,"sourceCode":"\n        Args:\n            command_executor: Either a string representing the URL of the remote\n                server or a custom remote_connection.RemoteConnection object.\n                Defaults to 'http://127.0.0.1:4444'.\n            keep_alive: (Deprecated) Whether to configure\n                remote_connection.RemoteConnection to use HTTP keep-alive.\n                Defaults to True.\n            file_detector: Pass a custom file detector object during\n                instantiation. If None, the default LocalFileDetector() will be\n                used.\n            options: Instance of a driver options.Options class.\n            locator_converter: Custom locator converter to use. Defaults to None.\n            web_element_cls: Custom class to use for web elements. Defaults to\n                WebElement.\n            client_config: Custom client configuration to use. Defaults to None.\n        \"\"\"\n        if options is None:\n            raise TypeError(\n                \"missing 1 required keyword-only argument: 'options' (instance of driver `options.Options` class)\"\n            )\n        elif isinstance(options, list):\n            capabilities = create_matches(options)\n            _ignore_local_proxy = False\n        else:\n            capabilities = options.to_capabilities()\n            _ignore_local_proxy = options._ignore_local_proxy\n        self.command_executor = command_executor\n        if isinstance(self.command_executor, (str, bytes)):\n            self.command_executor = get_remote_connection(\n                capabilities,\n                command_executor=command_executor,\n                keep_alive=keep_alive,\n                ignore_local_proxy=_ignore_local_proxy,\n                client_config=client_config,\n            )\n        self._is_remote = True","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/py/selenium/webdriver/remote/webdriver.py#L243-L279","documentation":"Raised in `WebDriver.__init__` when `options` is None — the constructor requires a keyword-only `options` argument (an instance of a driver's `Options` class, or a list of Options). The class historically accepted no options, but the API now mandates one so capabilities are derived deterministically. It is a TypeError.","triggerScenarios":"Instantiating `webdriver.Remote(...)` (or any driver) without passing options=, or passing options=None explicitly. Also using an old call style `webdriver.Remote(command_executor, desired_capabilities=...)` from pre-4.x tutorials.","commonSituations":"Upgrading from Selenium 3 to 4+ where options used to be optional; stale Stack Overflow examples; forgetting to import/construct the Options object for the target browser.","solutions":["Construct and pass the right Options, e.g. webdriver.Remote(options=ChromeOptions()).","For multi-browser, pass a list: options=[ChromeOptions(), ...] (create_matches is applied).","Remove legacy desired_capabilities= usage and migrate to Options."],"exampleFix":"# before\ndriver = webdriver.Remote(command_executor=URL)\n\n# after\nfrom selenium.webdriver.chrome.options import Options\nopts = Options()\ndriver = webdriver.Remote(command_executor=URL, options=opts)","handlingStrategy":"type-guard","validationCode":"if options is None:\n    raise TypeError('options is required; construct an Options instance for the target browser')","typeGuard":"def has_options(options) -> bool:\n    return options is not None and (hasattr(options, 'to_capabilities') or isinstance(options, list))","tryCatchPattern":null,"preventionTips":["Always build an Options object per driver; never rely on defaults.","When upgrading Selenium, audit Remote() calls for the now-mandatory options= kwarg."],"tags":["configuration","validation","api-migration","webdriver"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}