Method: Applitools::Selenium::Driver#find_elements

Defined in:
lib/applitools/selenium/driver.rb,
lib/applitools/selenium/driver.rb

#find_elements(how, what) ⇒ [Applitools::Selenium::Element]

Finds elements in a window.

Examples:

driver.find_elements :css, '.some_class'
driver.find_elements :css => '.some_class'
driver.find_elements :id, 'element_id'

Parameters:

  • how (Symbol)

    Defines the way that what parameter will be interpreted (finder). Can be one of: :class, :class_name, :css, :id, :link, :link_text, :name, :partial_link_text, :tag_name, :xpath

  • what (String)

    The selector to find an element

Returns:

Raises:

  • (ArgumentError)

    if invalid finder (how) is passed



170
171
172
173
174
175
176
# File 'lib/applitools/selenium/driver.rb', line 170

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

  raise ArgumentError, "cannot find element by: #{how.inspect}" unless FINDERS[how.to_sym]

  driver.find_elements(how, what).map { |el| Applitools::Selenium::Element.new(self, el) }
end