{"record":{"id":"8a0357c9a27f1ce6","repo":"teamcapybara/capybara","slug":"capybara-driver-base-accept-modal","errorCode":null,"errorMessage":"Capybara::Driver::Base#accept_modal","messagePattern":"Capybara::Driver::Base#accept_modal","errorType":"exception","errorClass":"Capybara::NotSupportedByDriverError","httpStatus":null,"severity":"error","filePath":"lib/capybara/driver/base.rb","lineNumber":139,"sourceCode":"    raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#switch_to_window'\n  end\n\n  def no_such_window_error\n    raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#no_such_window_error'\n  end\n\n  ##\n  #\n  # Execute the block, and then accept the modal opened.\n  # @param type [:alert, :confirm, :prompt]\n  # @option options [Numeric] :wait  How long to wait for the modal to appear after executing the block.\n  # @option options [String, Regexp] :text  Text to verify is in the message shown in the modal\n  # @option options [String] :with  Text to fill in in the case of a prompt\n  # @return [String]  the message shown in the modal\n  # @raise [Capybara::ModalNotFound]  if modal dialog hasn't been found\n  #\n  def accept_modal(type, **options, &blk)\n    raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#accept_modal'\n  end\n\n  ##\n  #\n  # Execute the block, and then dismiss the modal opened.\n  # @param type [:alert, :confirm, :prompt]\n  # @option options [Numeric] :wait  How long to wait for the modal to appear after executing the block.\n  # @option options [String, Regexp] :text  Text to verify is in the message shown in the modal\n  # @return [String]  the message shown in the modal\n  # @raise [Capybara::ModalNotFound]  if modal dialog hasn't been found\n  #\n  def dismiss_modal(type, **options, &blk)\n    raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#dismiss_modal'\n  end\n\n  def invalid_element_errors\n    []\n  end","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/teamcapybara/capybara/blob/15b5fdb76e972e9623d5af2123ed3755594f9732/lib/capybara/driver/base.rb#L121-L157","documentation":"Error \"Capybara::Driver::Base#accept_modal\" thrown in teamcapybara/capybara.","triggerScenarios":"Thrown at lib/capybara/driver/base.rb:139 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"}