Find the first element matching the given arguments.
@param [:class, :class_name, :id, :link_text, :link, :partial_link_text, :name, :tag_name, :xpath] how @param [String] what @return [WebDriver::Element]
@raise [NoSuchElementError] if the element doesn’t exist
# File common/src/rb/lib/selenium/webdriver/find.rb, line 28 def find_element(*args) how, what = extract_args(args) unless by = FINDERS[how.to_sym] raise ArgumentError, "cannot find element by #{how.inspect}" end meth = "findElementBy#{by}" what = what.to_s bridge.send meth, ref, what end
Find all elements matching the given arguments
@param [:class, :class_name, :id, :link_text, :link, :partial_link_text, :name, :tag_name, :xpath] how @param [String] what @return [Array<WebDriver::Element>]
# File common/src/rb/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
Generated with the Darkfish Rdoc Generator 2.