Method: Selenium::WebDriver::SearchContext#find_elements

Defined in:
lib/selenium/webdriver/common/search_context.rb

#find_elements(*args) ⇒ Array<WebDriver::Element>

Find all elements matching the given arguments

Parameters:

  • how (:class, :class_name, :id, :link_text, :link, :partial_link_text, :name, :tag_name, :xpath)
  • what (String)

Returns:

See Also:



57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/selenium/webdriver/common/search_context.rb', line 57

def find_elements(*args)
  how, what = extract_args(args)

  unless by = FINDERS[how.to_sym]
    raise ArgumentError, "cannot find elements by #{how.inspect}"
  end

  meth = "findElementsBy#{by}"
  what = what.to_s

  bridge.send meth, ref, what
end