{"record":{"id":"bfb2262ca931638e","repo":"SeleniumHQ/selenium","slug":"expected-input-and-output-file-paths-bfb226","errorCode":null,"errorMessage":"Expected input and output file paths","messagePattern":"Expected input and output file paths","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"javascript/atoms/typescript/wrap-find-elements-as-global.js","lineNumber":27,"sourceCode":"//   http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing,\n// software distributed under the License is distributed on an\n// \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n// KIND, either express or implied.  See the License for the\n// specific language governing permissions and limitations\n// under the License.\n\n// Wraps the compiled findElements TypeScript output as a browser global so that\n// test HTML pages can load it directly via <script> and access it as\n// window.bot.locators.typescript.findElements.\n\nconst fs = require('node:fs')\n\nconst [inputPath, outputPath] = process.argv.slice(2)\n\nif (!inputPath || !outputPath) {\n  throw new Error('Expected input and output file paths')\n}\n\nconst licenseHeader = `// Licensed to the Software Freedom Conservancy (SFC) under one\n// or more contributor license agreements.  See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership.  The SFC licenses this file\n// to you under the Apache License, Version 2.0 (the\n// \"License\"); you may not use this file except in compliance\n// with the License.  You may obtain a copy of the License at\n//\n//   http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing,\n// software distributed under the License is distributed on an\n// \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n// KIND, either express or implied.  See the License for the\n// specific language governing permissions and limitations\n// under the License.`","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/javascript/atoms/typescript/wrap-find-elements-as-global.js#L9-L45","documentation":"wrap-find-elements-as-global.js mirrors wrap-as-global.js but for the findElements TypeScript atom, exposing it as window.bot.locators.typescript.findElements. It requires two positional CLI args [inputPath, outputPath] and throws before file I/O if either is absent. Build-time helper invoked by Bazel, not user-facing.","triggerScenarios":"Running the script with zero or one argument. A Bazel macro that fails to substitute both $(location) labels for the findElements target. Passing undefined from a misconfigured rule.","commonSituations":"Editing the findElements atom BUILD file and dropping one path argument. Manual invocation during debugging. A target rename that breaks location expansion.","solutions":["Invoke as: node wrap-find-elements-as-global.js <compiled-input.js> <wrapped-output.js>.","Verify both $(location) expansions in the Bazel rule resolve to real files.","Confirm the upstream compile produced the input file.","Prefer running the Bazel target rather than the script directly."],"exampleFix":"// before\nnode javascript/atoms/typescript/wrap-find-elements-as-global.js find-elements.compiled.js\n\n// after\nnode javascript/atoms/typescript/wrap-find-elements-as-global.js find-elements.compiled.js find-elements.global.js","handlingStrategy":"validation","validationCode":"const [inputPath, outputPath] = process.argv.slice(2)\nif (!inputPath || !outputPath) {\n  console.error('Usage: wrap-find-elements-as-global.js <input.js> <output.js>')\n  process.exit(2)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass both input and output paths.","Verify Bazel $(location) expansions for both labels.","Run the Bazel target rather than the script directly.","Confirm upstream compile produced the input."],"tags":["build","nodejs","bazel","atoms","cli","typescript"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}