{"record":{"id":"dc91ac9abbbfae6f","repo":"SeleniumHQ/selenium","slug":"strategy-can-only-be-one-of-the-following-normal","errorCode":null,"errorMessage":"Strategy can only be one of the following: normal, eager, none","messagePattern":"Strategy can only be one of the following: normal, eager, none","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py/selenium/webdriver/common/options.py","lineNumber":86,"sourceCode":"\n    See:\n      - https://w3c.github.io/webdriver/#dfn-table-of-page-load-strategies.\n\n    Args:\n        strategy: the strategy corresponding to a document readiness state\n    \"\"\"\n\n    def __init__(self, name):\n        self.name = name\n\n    def __get__(self, obj, cls):\n        return obj._caps.get(self.name)\n\n    def __set__(self, obj, value):\n        if value in (\"normal\", \"eager\", \"none\"):\n            obj.set_capability(self.name, value)\n        else:\n            raise ValueError(\"Strategy can only be one of the following: normal, eager, none\")\n\n\nclass _UnHandledPromptBehaviorDescriptor:\n    \"\"\"How the driver should respond when an alert is present and the command sent is not handling the alert.\n\n    See:\n      - https://w3c.github.io/webdriver/#dfn-table-of-page-load-strategies:\n\n    Args:\n        behavior: behavior to use when an alert is encountered\n\n    Returns:\n        Values for implicit timeout, pageLoad timeout and script timeout if set (in milliseconds)\n    \"\"\"\n\n    def __init__(self, name):\n        self.name = name\n","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/py/selenium/webdriver/common/options.py#L68-L104","documentation":"The page_load_strategy property on an Options object validates that the value is one of the three W3C-defined strategies: 'normal', 'eager', or 'none'. Any other value raises ValueError. This maps to the W3C pageLoadStrategy capability.","triggerScenarios":"Setting options.page_load_strategy = 'fast', options.page_load_strategy = 'complete', or any string outside the allowed set. Case typos like 'Normal' or 'EAGER' also trigger it (comparison is case-sensitive, lowercase only).","commonSituations":"Confusing Selenium page-load strategies with browser/Playwright concepts ('domcontentloaded', 'load', 'networkidle'). Passing an enum or capitalized value. Copying config from a non-Selenium framework.","solutions":["Use one of the literal lowercase strings: 'normal', 'eager', or 'none'.","Use the PageLoadStrategy enum: options.page_load_strategy = PageLoadStrategy.eager.value.","Double-check casing — values must be lowercase."],"exampleFix":"# before\noptions.page_load_strategy = 'networkidle'  # raises ValueError\n\n# after\noptions.page_load_strategy = 'none'\n# or via enum\nfrom selenium.webdriver.common.options import PageLoadStrategy\noptions.page_load_strategy = PageLoadStrategy.eager.value","handlingStrategy":"validation","validationCode":"from selenium.webdriver.common.options import PageLoadStrategy\nvalid = {s.value for s in PageLoadStrategy}\nif strategy not in valid:\n    raise ValueError(f'Invalid page_load_strategy {strategy!r}; choose from {sorted(valid)}')\noptions.page_load_strategy = strategy","typeGuard":"from selenium.webdriver.common.options import PageLoadStrategy\ndef is_valid_page_load_strategy(v: str) -> bool:\n    return v in {s.value for s in PageLoadStrategy}","tryCatchPattern":"try:\n    options.page_load_strategy = strategy\nexcept ValueError:\n    options.page_load_strategy = 'normal'  # safe default","preventionTips":["Source the value from the PageLoadStrategy enum rather than a literal.","Lowercase and validate external input before assigning."],"tags":["options","page-load-strategy","validation","capabilities"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}