{"record":{"id":"9f4ed6c23ea50550","repo":"SeleniumHQ/selenium","slug":"do-not-know-how-to-build-driver-browser-did-y","errorCode":null,"errorMessage":"Do not know how to build driver: ${browser}; did you forget to call usingServer(url)?","messagePattern":"Do not know how to build driver: (.+?); did you forget to call usingServer\\(url\\)\\?","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"javascript/selenium-webdriver/index.js","lineNumber":719,"sourceCode":"        if (this.ieService_) {\n          service = this.ieService_.build()\n        }\n        return createDriver(ie.Driver, capabilities, service)\n      }\n\n      case Browser.EDGE: {\n        let service = null\n        if (this.edgeService_) {\n          service = this.edgeService_.build()\n        }\n        return createDriver(edge.Driver, capabilities, service)\n      }\n\n      case Browser.SAFARI:\n        return createDriver(safari.Driver, capabilities)\n\n      default:\n        throw new Error('Do not know how to build driver: ' + browser + '; did you forget to call usingServer(url)?')\n    }\n  }\n}\n\n/**\n * In the 3.x releases, the various browser option classes\n * (e.g. firefox.Options) had to be manually set as an option using the\n * Capabilities class:\n *\n *     let ffo = new firefox.Options();\n *     // Configure firefox options...\n *\n *     let caps = new Capabilities();\n *     caps.set('moz:firefoxOptions', ffo);\n *\n *     let driver = new Builder()\n *         .withCapabilities(caps)\n *         .build();","sourceCodeStart":701,"sourceCodeEnd":737,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/javascript/selenium-webdriver/index.js#L701-L737","documentation":"Thrown by Builder.build() in index.js when the resolved browser name does not match any native browser case (Chrome, Firefox, IE, Edge, Safari) in the switch statement and no remote server URL is configured. The default case fires. The hint 'did you forget to call usingServer(url)?' indicates non-native browsers require a remote Grid.","triggerScenarios":"Setting forBrowser('opera') or forBrowser('brave') without calling usingServer(). Typo in the browser name. Using a browser name not in the supported native set. SELENIUM_BROWSER env var set to an unsupported value.","commonSituations":"Using Opera/Brave/other Chromium derivatives that need a remote Grid; misspelling 'chrome' or 'firefox'; forgetting to configure the remote URL when targeting a Grid-only browser.","solutions":["Call Builder.usingServer(gridUrl) for browsers without native driver support.","Verify the browser name matches a Browser enum value (Browser.CHROME, Browser.FIREFOX, etc.).","Use forBrowser(Browser.CHROME) with the enum constant to avoid typos.","If targeting a Grid, ensure SELENIUM_REMOTE_URL or usingServer() is set."],"exampleFix":"// before\nnew Builder().forBrowser('opera').build()\n// after\nnew Builder().forBrowser('opera').usingServer('http://grid.example.com:4444').build()","handlingStrategy":"validation","validationCode":"const { Browser } = require('selenium-webdriver')\nconst NATIVE_BROWSERS = new Set([\n  Browser.CHROME, Browser.FIREFOX, Browser.INTERNET_EXPLORER,\n  Browser.EDGE, Browser.SAFARI,\n])\nfunction buildDriverSafe(builder, browser, gridUrl) {\n  if (!NATIVE_BROWSERS.has(browser) && !gridUrl) {\n    throw new Error(`Browser '${browser}' requires usingServer(gridUrl) because it has no native driver`)\n  }\n  return builder.forBrowser(browser).build()\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the Browser enum constants (Browser.CHROME) instead of string literals to avoid typos.","For non-native browsers (Opera, Brave), always call usingServer(gridUrl).","Verify the browser name is in the supported set before calling build().","Set SELENIUM_REMOTE_URL when targeting a Grid."],"tags":["builder","configuration","browser","driver","remote"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}