SeleniumHQ/selenium · error · Error::WebDriverError

unable to find profile named: #{name.inspect}

Error message

unable to find profile named: #{name.inspect}

What it means

Raised by Firefox::Profile.from_name (Error::WebDriverError) when no profile with the given name is found in Firefox's profiles.ini. The class method delegates to ProfilesIni and raises if the lookup returns nil.

Source

Thrown at rb/lib/selenium/webdriver/firefox/profile.rb:53

          'browser.usedOnWindows10.introURL' => 'about:blank',
          'network.captive-portal-service.enabled' => false,
          'security.csp.enable' => false
        }.freeze

        LOCK_FILES = %w[.parentlock parent.lock lock].freeze

        attr_reader :name, :log_file

        class << self
          def ini
            @ini ||= ProfilesIni.new
          end

          def from_name(name)
            profile = ini[name]
            return profile if profile

            raise Error::WebDriverError, "unable to find profile named: #{name.inspect}"
          end

          def decoded(json)
            JSON.parse(json)
          end
        end

        #
        # Create a new Profile instance
        #
        # @example User configured profile
        #
        #   profile = Selenium::WebDriver::Firefox::Profile.new
        #   profile['network.proxy.http'] = 'localhost'
        #   profile['network.proxy.http_port'] = 9090
        #
        #   driver = Selenium::WebDriver.for :firefox, :profile => profile
        #

View on GitHub (pinned to aa36b38e69)

Solutions

  1. List available profiles from profiles.ini and use an existing name.
  2. Create the profile in Firefox first (about:profiles) so it appears in profiles.ini.
  3. If you don't need an existing profile, use a fresh Profile.new instead of from_name.

Example fix

// before
profile = Selenium::WebDriver::Firefox::Profile.from_name('QA')

// after
# confirm available names first
available = Selenium::WebDriver::Firefox::Profile.ini.keys
profile = Selenium::WebDriver::Firefox::Profile.from_name('QA')
# or use a fresh profile
profile = Selenium::WebDriver::Firefox::Profile.new
Defensive patterns

Strategy: validation

Validate before calling

names = Selenium::WebDriver::Firefox::Profile.ini.keys
if names.include?(requested_name)
  profile = Selenium::WebDriver::Firefox::Profile.from_name(requested_name)
else
  profile = Selenium::WebDriver::Firefox::Profile.new  # fresh profile
end

Prevention

When it happens

Trigger: Calling Selenium::WebDriver::Firefox::Profile.from_name(name) with a name not listed in Firefox's profiles.ini; referencing a profile that was deleted; typo in the profile name.

Common situations: Running on a machine/container with no Firefox profile initialized; profile name read from config that doesn't match the local Firefox install; Selenium Grid node without the expected named profile.

Related errors


AI-assisted analysis of SeleniumHQ/selenium@aa36b38e69 (2026-08-14). Data as JSON: /api/errors/a1d634c3c3f24536. Report an issue: GitHub.