Method: Capybara::Node::Finders#find_by_id

Defined in:
lib/capybara/node/finders.rb

#find_by_id(id, **options, &optional_filter_block) ⇒ Capybara::Node::Element

Find a element on the page, given its id.

If the driver is capable of executing JavaScript, this method will wait for a set amount of time and continuously retry finding the element until either the element is found or the time expires. The length of time this method will wait is controlled through default_max_wait_time.

Parameters:

  • id (String)

    id of element

  • options (Hash)

    a customizable set of options

Options Hash (**options):

  • wait (false, true, Numeric)

    Maximum time to wait for matching element to appear. Defaults to default_max_wait_time.

Returns:


196
197
198
# File 'lib/capybara/node/finders.rb', line 196

def find_by_id(id, **options, &optional_filter_block)
  find(:id, id, **options, &optional_filter_block)
end