{"record":{"id":"eb0f665757df8084","repo":"teamcapybara/capybara","slug":"the-racktest-driver-does-not-support-click-options","errorCode":null,"errorMessage":"The RackTest driver does not support click options","messagePattern":"The RackTest driver does not support click options","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/capybara/rack_test/node.rb","lineNumber":63,"sourceCode":"    end\n  end\n\n  def select_option\n    return if disabled?\n\n    deselect_options unless select_node.multiple?\n    native['selected'] = 'selected'\n  end\n\n  def unselect_option\n    raise Capybara::UnselectNotAllowed, 'Cannot unselect option from single select box.' unless select_node.multiple?\n\n    native.remove_attribute('selected')\n  end\n\n  def click(keys = [], **options)\n    options.delete(:offset)\n    raise ArgumentError, 'The RackTest driver does not support click options' unless keys.empty? && options.empty?\n\n    if link?\n      follow_link\n    elsif submits?\n      associated_form = form\n      Capybara::RackTest::Form.new(driver, associated_form).submit(self) if associated_form\n    elsif checkable?\n      set(!checked?)\n    elsif tag_name == 'label'\n      click_label\n    elsif (details = native.xpath('.//ancestor-or-self::details').last)\n      toggle_details(details)\n    end\n  end\n\n  def tag_name\n    native.node_name\n  end","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/teamcapybara/capybara/blob/15b5fdb76e972e9623d5af2123ed3755594f9732/lib/capybara/rack_test/node.rb#L45-L81","documentation":"rack_test performs clicks purely via DOM semantics (follow links, submit forms, toggle checkboxes/labels/details) - there is no rendering engine to apply coordinates or modifier keys. Node#click silently strips :offset, but any modifier key or remaining option raises ArgumentError. This is a capability guard, not a transient failure.","triggerScenarios":"find('.row').click(:ctrl); el.click(x: 10, y: 10) (offset is dropped, but x:/y: outside :offset raise - here :offset is the deleted key, so passing x:/y: still raises); find('a').click(:shift, :meta); shared interaction steps run under the default :rack_test driver.","commonSituations":"A suite mixes rack_test (default) and selenium (js: true) specs, and modifier-key clicks written for selenium leak into untagged specs; row-activation interactions that in the real app are JS click handlers, which rack_test cannot execute anyway.","solutions":["Remove keys/options from the click call for specs that run under rack_test.","Tag the spec js: true and run it under selenium/cuprite so modifiers and offsets work.","Branch on driver in shared helpers: plain click for :rack_test, enriched click otherwise.","For keyboard-driven UI, drive the underlying DOM effect directly (check a box, follow the link) rather than simulating chords."],"exampleFix":"# before\nfind('a.external').click(:ctrl, :shift) # runs under rack_test\n\n# after\nfind('a.external').click if Capybara.current_driver == :rack_test\nfind('a.external').click(:ctrl, :shift) if Capybara.current_driver != :rack_test","handlingStrategy":"validation","validationCode":"def rack_test_safe_click?(keys, options)\n  Capybara.current_driver == :rack_test ? keys.empty? && options.except(:offset).empty? : true\nend","typeGuard":"def enhanced_click_supported?\n  Capybara.current_driver != :rack_test\nend","tryCatchPattern":null,"preventionTips":["Keep modifier-key/coordinate clicks inside specs tagged for a JS driver; plain click under rack_test.","In shared step definitions, branch on Capybara.current_driver instead of passing options unconditionally."],"tags":["ruby","capybara","rack-test","interaction","driver-capabilities"],"backgroundTag":"unsupported-driver-operation","analyzedSha":"15b5fdb76e972e9623d5af2123ed3755594f9732","analyzedAt":"2026-08-21T16:53:45.588Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}