{"record":{"id":"ff5372fea7fce289","repo":"SeleniumHQ/selenium","slug":"could-not-find-extension-at-path-inspect-ff5372","errorCode":null,"errorMessage":"could not find extension at #{path.inspect}","messagePattern":"could not find extension at #(.+?)","errorType":"exception","errorClass":"Error::WebDriverError","httpStatus":null,"severity":"error","filePath":"rb/lib/selenium/webdriver/chromium/profile.rb","lineNumber":44,"sourceCode":"\n      class Profile\n        include ProfileHelper\n\n        def initialize(model = nil)\n          WebDriver.logger.deprecate(\n            'Chromium::Profile (including Chrome::Profile and Edge::Profile)',\n            \"Options#add_argument('--user-data-dir=...'), Options#add_preference, and Options#add_extension\",\n            id: :chromium_profile\n          )\n\n          @model = verify_model(model)\n          @extensions = []\n          @encoded_extensions = []\n          @directory = nil\n        end\n\n        def add_extension(path)\n          raise Error::WebDriverError, \"could not find extension at #{path.inspect}\" unless File.file?(path)\n\n          @extensions << path\n        end\n\n        def add_encoded_extension(encoded)\n          @encoded_extensions << encoded\n        end\n\n        def directory\n          @directory || layout_on_disk\n        end\n\n        #\n        # Set a preference in the profile.\n        #\n        # See https://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/pref_names.cc\n        #\n","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rb/lib/selenium/webdriver/chromium/profile.rb#L26-L62","documentation":"The deprecated Chromium::Profile#add_extension (Chrome::Profile / Edge::Profile) raises Error::WebDriverError when no regular file exists at the given path. Profile-based extension loading is deprecated in favor of Options#add_extension; the same file-existence check applies.","triggerScenarios":"Calling profile.add_extension(path) on a Chromium::Profile/Chrome::Profile/Edge::Profile where File.file?(path) is false.","commonSituations":"Using the old Profile API instead of Options, relative path issues, missing .crx at runtime, following outdated examples.","solutions":["Migrate to Options#add_extension (the supported API): options.add_extension(path).","Pass an absolute path to an existing .crx file.","Verify the file exists with File.file?(path) before calling.","Heed the :chromium_profile deprecation warning and switch to Options-based config."],"exampleFix":"// before\nprofile = Selenium::WebDriver::Chrome::Profile.new\nprofile.add_extension('ext.crx')\n// after\noptions = Selenium::WebDriver::Chrome::Options.new\noptions.add_extension(File.expand_path('ext.crx', __dir__))","handlingStrategy":"validation","validationCode":"raise 'migrate to Options' if defined?(profile)\n# Use the supported API:\noptions.add_extension(path) if File.file?(path) && File.extname(path) == '.crx'","typeGuard":"def valid_extension_path?(path)\n  File.file?(path) && File.extname(path).casecmp?('.crx')\nend","tryCatchPattern":"begin\n  profile.add_extension(path)\nrescue Selenium::WebDriver::Error::WebDriverError => e\n  raise unless e.message =~ /could not find extension/\n  options.add_extension(File.expand_path(path, __dir__))\nend","preventionTips":["Migrate off Chromium::Profile to Options-based configuration.","Use absolute .crx paths and validate existence before calling.","Watch for the :chromium_profile deprecation warning and act on it."],"tags":["chromium","extension","profile","deprecated","filesystem","ruby"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}