Method: Selenium::WebDriver::SearchContext#find_element
- Defined in:
- lib/selenium/webdriver/common/search_context.rb
#find_element(how, what) ⇒ Element #find_element(opts) ⇒ Element
Find the first element matching the given arguments
When using Element#find_element with :xpath, be aware that webdriver follows standard conventions: a search prefixed with “//” will search the entire document, not just the children of this current node. Use “.//” to limit your search to the children of the receiving Element.
65 66 67 68 69 70 71 72 |
# File 'lib/selenium/webdriver/common/search_context.rb', line 65 def find_element(*args) how, what = extract_args(args) by = SearchContext.finders[how.to_sym] raise ArgumentError, "cannot find element by #{how.inspect}" unless by bridge.find_element_by by, what, ref end |