{"record":{"id":"35742e4dd5339017","repo":"SeleniumHQ/selenium","slug":"expected-proxy-name-got-proxy-inspect-pro","errorCode":null,"errorMessage":"expected #{Proxy.name}, got #{proxy.inspect}:#{proxy.class}","messagePattern":"expected #(.+?), got #(.+?):#(.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"rb/lib/selenium/webdriver/firefox/profile.rb","lineNumber":138,"sourceCode":"\n        def load_no_focus_lib=(value)\n          WebDriver.logger.deprecate('Firefox::Profile#load_no_focus_lib=', id: :firefox_profile)\n          @load_no_focus_lib = value\n        end\n\n        def log_file=(file)\n          @log_file = file\n          self[WEBDRIVER_PREFS[:log_file]] = file\n        end\n\n        def add_extension(path, name = extension_name_for(path))\n          WebDriver.logger.deprecate('Firefox::Profile#add_extension', 'Driver#install_addon',\n                                     id: :firefox_profile)\n          @extensions[name] = Extension.new(path)\n        end\n\n        def proxy=(proxy)\n          raise TypeError, \"expected #{Proxy.name}, got #{proxy.inspect}:#{proxy.class}\" unless proxy.is_a? Proxy\n\n          case proxy.type\n          when :manual\n            self['network.proxy.type'] = 1\n\n            set_manual_proxy_preference 'http', proxy.http\n            set_manual_proxy_preference 'ssl', proxy.ssl\n            set_manual_proxy_preference 'socks', proxy.socks\n\n            self['network.proxy.no_proxies_on'] = proxy.no_proxy || ''\n          when :pac\n            self['network.proxy.type'] = 2\n            self['network.proxy.autoconfig_url'] = proxy.pac\n          when :auto_detect\n            self['network.proxy.type'] = 4\n          else\n            raise ArgumentError, \"unsupported proxy type #{proxy.type}\"\n          end","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rb/lib/selenium/webdriver/firefox/profile.rb#L120-L156","documentation":"Raised by Firefox::Profile#proxy= (TypeError) when the argument is not an instance of Selenium::WebDriver::Proxy. The setter then switches on proxy.type to configure the corresponding network.proxy.* preferences.","triggerScenarios":"Assigning a hash of proxy settings (e.g. {type: :manual, http: 'host:8080'}) or a URI/string instead of a Proxy object to profile.proxy=.","commonSituations":"Building proxy config from a hash read out of Capabilities by mistake; passing the proxy at the wrong layer (profile vs Capabilities); confusing this with the Capabilities proxy= which accepts a hash.","solutions":["Construct a Selenium::WebDriver::Proxy.new(type: :manual, http: 'host:8080') and assign that.","Prefer setting the proxy on Capabilities (options.proxy = Proxy.new(...)) rather than on the Firefox profile directly.","If you only have a hash, convert it with Proxy.new(hash)."],"exampleFix":"// before\nprofile.proxy = {type: :manual, http: 'proxy.example.com:8080'}\n\n// after\nprofile.proxy = Selenium::WebDriver::Proxy.new(\n  type: :manual, http: 'proxy.example.com:8080'\n)\n# or preferred: set on capabilities\noptions = Selenium::WebDriver::Firefox::Options.new\noptions.proxy = Selenium::WebDriver::Proxy.new(type: :manual, http: 'proxy.example.com:8080')","handlingStrategy":"type-guard","validationCode":"proxy = Selenium::WebDriver::Proxy.new(proxy_hash) unless proxy.is_a?(Selenium::WebDriver::Proxy)\nprofile.proxy = proxy","typeGuard":"def selenium_proxy?(obj)\n  obj.is_a?(Selenium::WebDriver::Proxy)\nend","tryCatchPattern":null,"preventionTips":["Always build a Selenium::WebDriver::Proxy object before assigning it.","Prefer setting proxy on Options/Capabilities rather than the Firefox profile.","Convert proxy hashes with Proxy.new(hash) before assignment."],"tags":["firefox","profile","proxy","type-error"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}