Method: Selenium::WebDriver::Find#find_elements

Defined in:
lib/selenium/webdriver/find.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:



49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/selenium/webdriver/find.rb', line 49

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