{"record":{"id":"c48da3abcec4d2eb","repo":"teamcapybara/capybara","slug":"the-from-option-does-not-take-an-element","errorCode":null,"errorMessage":"The :from option does not take an element","messagePattern":"The :from option does not take an element","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/capybara/node/actions.rb","lineNumber":202,"sourceCode":"      # If `from` option is present, {#select} finds a select box, or text input with associated datalist,\n      # on the page and selects a particular option from it.\n      # Otherwise it finds an option inside current scope and selects it.\n      # If the select box is a multiple select, {#select} can be called multiple times to select more than\n      # one option.\n      # The select box can be found via its name, id, {Capybara.configure test_id} attribute, or label text.\n      # The option can be found by its text.\n      #\n      #     page.select 'March', from: 'Month'\n      #\n      # @overload select(value = nil, from: nil, **options)\n      #   @macro waiting_behavior\n      #\n      #   @param value [String] Which option to select\n      #   @param from [String]  The id, {Capybara.configure test_id} attribute, name or label of the select box\n      #\n      # @return [Capybara::Node::Element]  The option element selected\n      def select(value = nil, from: nil, **options)\n        raise ArgumentError, 'The :from option does not take an element' if from.is_a? Capybara::Node::Element\n\n        el = from ? find_select_or_datalist_input(from, options) : self\n\n        if el.respond_to?(:tag_name) && (el.tag_name == 'input')\n          select_datalist_option(el, value)\n        else\n          el.find(:option, value, **options).select_option\n        end\n      end\n\n      ##\n      #\n      # Find a select box on the page and unselect a particular option from it. If the select\n      # box is a multiple select, {#unselect} can be called multiple times to unselect more than\n      # one option. The select box can be found via its name, id, {Capybara.configure test_id} attribute,\n      # or label text.\n      #\n      #     page.unselect 'March', from: 'Month'","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/teamcapybara/capybara/blob/15b5fdb76e972e9623d5af2123ed3755594f9732/lib/capybara/node/actions.rb#L184-L220","documentation":"Error \"The :from option does not take an element\" thrown in teamcapybara/capybara.","triggerScenarios":"Thrown at lib/capybara/node/actions.rb:202 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"}