{"record":{"id":"9560ed7a26738591","repo":"teamcapybara/capybara","slug":"value-cannot-be-an-array-when-multiple-attribute-9560ed","errorCode":null,"errorMessage":"Value cannot be an Array when 'multiple' attribute is not present. Not a #{value.class}","messagePattern":"Value cannot be an Array when 'multiple' attribute is not present\\. Not a #(.+?)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/capybara/selenium/node.rb","lineNumber":61,"sourceCode":"  ##\n  #\n  # Set the value of the form element to the given value.\n  #\n  # @param [String] value    The new value\n  # @param [Hash{}] options  Driver specific options for how to set the value\n  # @option options [Symbol,Array] :clear (nil) The method used to clear the previous value <br/>\n  #   nil => clear via javascript <br/>\n  #   :none =>  append the new value to the existing value <br/>\n  #   :backspace => send backspace keystrokes to clear the field <br/>\n  #   Array => an array of keys to send before the value being set, e.g. [[:command, 'a'], :backspace]\n  # @option options [Boolean] :rapid (nil) Whether setting text inputs should use a faster &quot;rapid&quot; mode<br/>\n  #   nil => Text inputs with length greater than 30 characters will be set using a faster driver script mode<br/>\n  #   true => Rapid mode will be used regardless of input length<br/>\n  #   false => Sends keys via conventional mode. This may be required to avoid losing key-presses if you have certain\n  #            Javascript interactions on form inputs<br/>\n  def set(value, **options)\n    if value.is_a?(Array) && !multiple?\n      raise ArgumentError, \"Value cannot be an Array when 'multiple' attribute is not present. Not a #{value.class}\"\n    end\n\n    tag_name, type = attrs(:tagName, :type).map { |val| val&.downcase }\n    @tag_name ||= tag_name\n\n    case tag_name\n    when 'input'\n      case type\n      when 'radio'\n        click\n      when 'checkbox'\n        click if value ^ checked?\n      when 'file'\n        set_file(value)\n      when 'date'\n        set_date(value)\n      when 'time'\n        set_time(value)","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/teamcapybara/capybara/blob/15b5fdb76e972e9623d5af2123ed3755594f9732/lib/capybara/selenium/node.rb#L43-L79","documentation":"Error \"Value cannot be an Array when 'multiple' attribute is not present. Not a #{value.class}\" thrown in teamcapybara/capybara.","triggerScenarios":"Thrown at lib/capybara/selenium/node.rb:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"15b5fdb76e972e9623d5af2123ed3755594f9732","analyzedAt":"2026-08-21T16:53:45.588Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}