{"record":{"id":"d94c9bcd06d36520","repo":"SeleniumHQ/selenium","slug":"not-a-file-path-inspect","errorCode":null,"errorMessage":"not a file: #{path.inspect}","messagePattern":"not a file: #(.+?)","errorType":"exception","errorClass":"Error::WebDriverError","httpStatus":null,"severity":"error","filePath":"rb/lib/selenium/webdriver/common/platform.rb","lineNumber":136,"sourceCode":"        `cygpath #{flags.join ' '} \"#{path}\"`.strip\n      end\n\n      def unix_path(path)\n        path.tr(File::ALT_SEPARATOR, File::SEPARATOR)\n      end\n\n      def windows_path(path)\n        path.tr(File::SEPARATOR, File::ALT_SEPARATOR)\n      end\n\n      def make_writable(file)\n        File.chmod 0o766, file\n      end\n\n      def assert_file(path)\n        return if File.file? path\n\n        raise Error::WebDriverError, \"not a file: #{path.inspect}\"\n      end\n\n      def assert_executable(path)\n        assert_file(path)\n\n        return if File.executable? path\n\n        raise Error::WebDriverError, \"not executable: #{path.inspect}\"\n      end\n\n      def exit_hook\n        pid = Process.pid\n\n        at_exit { yield if Process.pid == pid }\n      end\n\n      def localhost\n        info = Socket.getaddrinfo 'localhost', 80, Socket::AF_INET, Socket::SOCK_STREAM","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rb/lib/selenium/webdriver/common/platform.rb#L118-L154","documentation":"assert_file raises WebDriverError when the given path does not exist as a regular file. It is used to validate driver executable paths before launch (assert_executable calls it first). A directory, a missing path, or a broken symlink all trigger this error.","triggerScenarios":"Pointing a Service or DriverFinder at a path that does not exist. Setting driver path via Selenium::WebDriver::Chrome::Service.driver_path= to a wrong location. Passing a directory path where a binary file is expected.","commonSituations":"Driver binary not downloaded/installed. Typo in the configured path. Path is correct on one machine but missing in CI. Using a relative path that resolves differently.","solutions":["Verify the path exists with File.file?(path) and correct it.","Let Selenium Manager auto-manage the driver by not setting a manual driver_path.","Use an absolute path to avoid working-directory ambiguity.","Ensure the driver binary is downloaded to the configured location in CI."],"exampleFix":"# before\nSelenium::WebDriver::Chrome::Service.driver_path = '/wrong/path/chromedriver'\n\n# after (let Selenium Manager handle it)\nSelenium::WebDriver::Chrome::Service.driver_path = nil\n# or point to the real file\nSelenium::WebDriver::Chrome::Service.driver_path = '/usr/local/bin/chromedriver'","handlingStrategy":"validation","validationCode":"raise ArgumentError, \"driver not found at #{path}\" unless path && File.file?(path)","typeGuard":"def driver_file?(path)\n  !path.nil? && File.file?(path)\nend","tryCatchPattern":"begin\n  Selenium::WebDriver::Chrome::Service.driver_path = path\n  Selenium::WebDriver.for(:chrome)\nrescue Selenium::WebDriver::Error::WebDriverError => e\n  raise unless e.message.include?('not a file')\n  Selenium::WebDriver.for(:chrome) # let Selenium Manager auto-resolve\nend","preventionTips":["Prefer letting Selenium Manager auto-manage the driver path.","Use absolute paths and verify with File.file? before assignment.","Ensure CI images download the driver to a known, stable location."],"tags":["ruby","platform","driver-path","filesystem"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}